From bb3e16e9745abc5d625a8254303c3875c7a04ebf Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 8 Jan 2007 18:25:37 +0000 Subject: WP Merge to 4701 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@832 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/admin-functions.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'wp-admin/admin-functions.php') diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index ca4a002..94f6cc8 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -497,7 +497,7 @@ function edit_user( $user_id = 0 ) { if (!empty ( $pass1 )) $user->user_pass = $pass1; - if ( !validate_username( $user->user_login ) ) + if ( !$update && !validate_username( $user->user_login ) ) $errors->add( 'user_login', __( 'ERROR: This username is invalid. Please enter a valid username.' )); if (!$update && username_exists( $user->user_login )) @@ -600,7 +600,7 @@ function checked( $checked, $current) { function return_categories_list( $parent = 0 ) { global $wpdb; - return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC" ); + return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( link_count = 0 OR category_count != 0 ) ORDER BY category_count DESC" ); } function sort_cats( $cat1, $cat2 ) { @@ -678,7 +678,7 @@ function dropdown_categories( $default = 0 ) { function return_link_categories_list( $parent = 0 ) { global $wpdb; - return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY link_count DESC" ); + return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND (category_count = 0 OR link_count != 0) ORDER BY link_count DESC" ); } function get_nested_link_categories( $default = 0, $parent = 0 ) { @@ -760,7 +760,7 @@ function _cat_row( $category, $level, $name_override = false ) { $default_link_cat_id = get_option( 'default_link_category' ); if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_cat_id ) ) - $edit .= "cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf( __("You are about to delete the category "%s".\\nAll of its posts will go into the default category of "%s"\\nAll of its bookmarks will go into the default category of "%s".\\n"OK" to delete, "Cancel" to stop." ), js_escape( $category->cat_name ), js_escape( get_catname( $default_cat_id )), js_escape( get_catname( $default_link_cat_id ) ) ) . "' );\" class='delete'>".__( 'Delete' ).""; + $edit .= "cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . js_escape(sprintf( __("You are about to delete the category '%s'.\nAll of its posts will go into the default category of '%s'\nAll of its bookmarks will go into the default category of '%s'.\n'OK' to delete, 'Cancel' to stop." ), $category->cat_name, get_catname( $default_cat_id ), get_catname( $default_link_cat_id ) )) . "' );\" class='delete'>".__( 'Delete' ).""; else $edit .= "".__( "Default" ); } else @@ -808,7 +808,7 @@ function page_rows( $parent = 0, $level = 0, $pages = 0, $hierarchy = true ) { post_modified ) _e('Unpublished'); else echo mysql2date( 'Y-m-d g:i a', $post->post_modified ); ?> " . __( 'Edit' ) . ""; } ?> - " . __( 'Delete' ) . ""; } ?> + " . __( 'Delete' ) . ""; } ?> "; $r .= "\n\t\t"; $r .= "\n\t\t"; - $r .= "\n\t\t
"; + $r .= "\n\t\t
"; $r .= "\n\t\t"; + $r .= js_escape(sprintf( __("You are about to delete the '%s' custom field on this post.\n'OK' to delete, 'Cancel' to stop." ), $key_js ) ); + $r .= "' );\" class='deletemeta' tabindex='6' value='".attribute_escape(__( 'Delete' ))."' />"; $r .= "\n\t"; } echo $r; -- cgit