From e25a65b36a900d9904a8776cfdf8be547939c2b5 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 17 Mar 2010 16:27:25 +0000 Subject: [PATCH] Trim trailing whitespace git-svn-id: http://svn.automattic.com/wordpress/trunk@13733 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-header.php | 12 ++-- wp-admin/css/install.dev.css | 2 +- wp-admin/edit-tags.php | 2 +- wp-admin/export.php | 2 +- wp-admin/includes/class-wp-upgrader.php | 2 +- wp-admin/includes/export.php | 44 +++++++------- wp-admin/includes/file.php | 2 +- wp-admin/includes/misc.php | 6 +- wp-admin/includes/ms.php | 8 +-- wp-admin/includes/nav-menu.php | 52 ++++++++-------- wp-admin/includes/plugin.php | 2 +- wp-admin/includes/post.php | 10 ++-- wp-admin/includes/template.php | 28 ++++----- wp-admin/includes/upgrade.php | 6 +- wp-admin/js/common.dev.js | 4 +- wp-admin/js/inline-edit-post.dev.js | 2 +- wp-admin/js/nav-menu.dev.js | 80 ++++++++++++------------- wp-admin/menu.php | 4 +- wp-admin/ms-edit.php | 6 +- wp-admin/ms-sites.php | 18 +++--- wp-admin/ms-users.php | 2 +- wp-admin/nav-menus.php | 36 +++++------ wp-admin/network.php | 2 +- wp-admin/options.php | 2 +- wp-admin/plugins.php | 8 +-- wp-admin/tools.php | 10 ++-- wp-admin/update-core.php | 2 +- wp-admin/update.php | 2 +- wp-admin/upload.php | 2 +- wp-includes/default-filters.php | 2 +- wp-includes/default-widgets.php | 20 +++---- wp-includes/formatting.php | 2 +- wp-includes/functions.php | 2 +- wp-includes/l10n.php | 2 +- wp-includes/link-template.php | 2 +- wp-includes/nav-menu-template.php | 54 ++++++++--------- wp-includes/nav-menu.php | 32 +++++----- wp-includes/pluggable.php | 2 +- wp-includes/post.php | 16 ++--- wp-includes/query.php | 8 +-- wp-includes/rewrite.php | 4 +- wp-includes/taxonomy.php | 14 ++--- wp-signup.php | 2 +- 43 files changed, 260 insertions(+), 260 deletions(-) diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index 63f739e6b..46f798c79 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -35,15 +35,15 @@ $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); //', + 'url': '', 'uid': 'ID; ?>', 'time':'' }, - ajaxurl = '', - pagenow = 'id; ?>', - typenow = 'post_type) ) echo $current_screen->post_type; ?>', - adminpage = '', - thousandsSeparator = 'number_format['thousands_sep'] ); ?>', + ajaxurl = '', + pagenow = 'id; ?>', + typenow = 'post_type) ) echo $current_screen->post_type; ?>', + adminpage = '', + thousandsSeparator = 'number_format['thousands_sep'] ); ?>', decimalPoint = 'number_format['decimal_point'] ); ?>'; //]]> diff --git a/wp-admin/css/install.dev.css b/wp-admin/css/install.dev.css index 074cf2538..c1a50a641 100644 --- a/wp-admin/css/install.dev.css +++ b/wp-admin/css/install.dev.css @@ -53,7 +53,7 @@ abbr { margin: 6px 0 14px 0; border-bottom: none; text-align:center -} +} .step { margin: 20px 0 15px; diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index d8fa65334..4c29a707d 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -305,7 +305,7 @@ if ( $page_links )
-

tag to category converter'), 'admin.php?import=wp-cat2tag&step=3') ;?>.

+

tag to category converter'), 'admin.php?import=wp-cat2tag&step=3') ;?>.

' . + $months .= "\t\t\t\n"; } ?> diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index f7500bbb2..6b6458fed 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -1086,7 +1086,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin { function error($error) { if ( is_string($error) && isset( $this->upgrader->strings[$error] ) ) $this->error = $this->upgrader->strings[$error]; - + if ( is_wp_error($error) && $error->get_error_code() ) { foreach ( $error->get_error_messages() as $emessage ) { if ( $error->get_error_data() ) diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php index 5318e82b1..d58a31428 100644 --- a/wp-admin/includes/export.php +++ b/wp-admin/includes/export.php @@ -38,28 +38,28 @@ header('Content-Description: File Transfer'); header("Content-Disposition: attachment; filename=$filename"); header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); -if ( $post_type and $post_type != 'all' ) { - $where = $wpdb->prepare("WHERE post_type = %s ", $post_type); -} else { - $where = "WHERE post_type != 'revision' "; -} -if ( $author and $author != 'all' ) { - $author_id = (int) $author; - $where .= $wpdb->prepare("AND post_author = %d ", $author_id); -} -if ( $start_date and $start_date != 'all' ) { - $where .= $wpdb->prepare("AND post_date >= %s ", $start_date); -} -if ( $end_date and $end_date != 'all' ) { - $where .= $wpdb->prepare("AND post_date < %s ", $end_date); -} -if ( $category and $category != 'all' ) { - $taxomony_id = (int) $category; - $where .= $wpdb->prepare("AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} " . "WHERE term_taxonomy_id = %d) ", $taxomony_id); -} -if ( $status and $status != 'all' ) { - $where .= $wpdb->prepare("AND post_status = %s ", $status); -} +if ( $post_type and $post_type != 'all' ) { + $where = $wpdb->prepare("WHERE post_type = %s ", $post_type); +} else { + $where = "WHERE post_type != 'revision' "; +} +if ( $author and $author != 'all' ) { + $author_id = (int) $author; + $where .= $wpdb->prepare("AND post_author = %d ", $author_id); +} +if ( $start_date and $start_date != 'all' ) { + $where .= $wpdb->prepare("AND post_date >= %s ", $start_date); +} +if ( $end_date and $end_date != 'all' ) { + $where .= $wpdb->prepare("AND post_date < %s ", $end_date); +} +if ( $category and $category != 'all' ) { + $taxomony_id = (int) $category; + $where .= $wpdb->prepare("AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} " . "WHERE term_taxonomy_id = %d) ", $taxomony_id); +} +if ( $status and $status != 'all' ) { + $where .= $wpdb->prepare("AND post_status = %s ", $status); +} // grab a snapshot of post IDs, just in case it changes during the export $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC"); diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 24228b962..6e80d2e0d 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -313,7 +313,7 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) { // A writable uploads dir will pass this test. Again, there's no point overriding this one. if ( ! ( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] ) ) - return call_user_func($upload_error_handler, $file, $uploads['error'] ); + return call_user_func($upload_error_handler, $file, $uploads['error'] ); $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 77a4feead..3bf91696f 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -656,15 +656,15 @@ function win_is_writable($path) { /** * Send a HTTP header to disable content type sniffing in browsers which support it. - * + * * @link http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx * @link http://src.chromium.org/viewvc/chrome?view=rev&revision=6985 - * + * * @since 3.0.0. * @return none */ function send_nosniff_header() { - @header( 'X-Content-Type-Options: nosniff' ); + @header( 'X-Content-Type-Options: nosniff' ); } /** * Display the default admin color scheme picker (Used in user-edit.php) diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index 950a7a231..e7c7236ea 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -168,7 +168,7 @@ function confirm_delete_users( $users ) { global $current_user; if ( !is_array( $users ) ) return false; - + screen_icon('tools'); ?>

@@ -183,13 +183,13 @@ function confirm_delete_users( $users ) { foreach ( ( $allusers = (array) $_POST['allusers'] ) as $key => $val ) { if ( $val != '' && $val != '0' ) { $delete_user = new WP_User( $val ); - + if ( in_array( $delete_user->user_login, $site_admins ) ) wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network admnistrator.' ), $delete_user->user_login ) ); - + echo "\n"; $blogs = get_blogs_of_user( $val, true ); - + if ( !empty( $blogs ) ) { echo '

' . sprintf( __( 'Sites from %s:' ), $delete_user->user_login ) . '

'; foreach ( (array) $blogs as $key => $details ) { diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index 43e0ad2cb..207387a25 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -13,7 +13,7 @@ wp_nav_menu_taxonomy_metaboxes(); */ function wp_nav_menu_post_type_metaboxes() { $post_types = get_post_types( array( 'public' => true ), 'object' ); - + if ( !$post_types ) return false; @@ -99,10 +99,10 @@ function wp_nav_menu_create_metabox() { ?> */ function wp_nav_menu_item_link_metabox() { $args = array( 'post_status' => 'any', 'post_type' => 'nav_menu_item', 'meta_value' => 'custom', 'showposts' => -1 ); - + // @todo transient caching of these results with proper invalidation on updating links $query = new WP_Query( $args ); - + ?> - +

@@ -146,16 +146,16 @@ function wp_nav_menu_item_link_metabox() { */ function wp_nav_menu_item_post_type_metabox( $object, $post_type ) { $args = array( 'post_type' => $post_type['args']->name, 'post_status' => 'publish', 'showposts' => -1 ); - + if ( 'attachment' == $post_type['args']->name ) $args['post_status'] = 'any'; - + // @todo transient caching of these results with proper invalidation on updating of a post of this type $query = new WP_Query( $args ); - + if ( !$query->posts ) $error = '

  • '. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'
  • '; - + $pt_names = ''; if ( is_array($query->posts) ) { foreach ( $query->posts as $post ) { @@ -166,19 +166,19 @@ function wp_nav_menu_item_post_type_metabox( $object, $post_type ) { } } } - + $id = $post_type['args']->name; ?>

    - +

    - +
      @@ -218,10 +218,10 @@ function wp_nav_menu_item_taxonomy_metabox( $object, $taxonomy ) { // @todo transient caching of these results with proper invalidation on updating of a tax of this type $terms = get_terms( $taxonomy['args']->name, $args ); - + if ( !$terms ) $error = '
    • '. sprintf( __( 'No %s exists' ), $taxonomy['args']->label ) .'
    • '; - + $term_names = ''; if ( is_array($terms) ) { foreach ( $terms as $term ) { @@ -232,19 +232,19 @@ function wp_nav_menu_item_taxonomy_metabox( $object, $taxonomy ) { } } } - + $id = $taxonomy['args']->name; ?>

      - +

      - +
        @@ -281,7 +281,7 @@ function wp_nav_menu_item_taxonomy_metabox( $object, $taxonomy ) { function wp_nav_menu_get_items( $menu_items, $object_type, $object = null, $context = 'frontend' ) { if ( !$menu_items ) return __( 'Not Found' ); - + $output = ''; $i = 1; foreach ( $menu_items as $menu_item ) { @@ -289,16 +289,16 @@ function wp_nav_menu_get_items( $menu_items, $object_type, $object = null, $cont // so we don't have to duplicate this entire function. if ( !isset($menu_item->post_parent) ) $menu_item->post_parent = $menu_item->parent; - + // Cleanest way to get all attachements if ( 'attachment' == $object ) $menu_item->post_parent = 0; - + if ( 0 == $menu_item->post_parent ) { // Set up the menu item - $menu_item = wp_setup_nav_menu_item( $menu_item, $object_type, $object ); + $menu_item = wp_setup_nav_menu_item( $menu_item, $object_type, $object ); $attributes = ( 'backend' == $context ) ? ' id="menu-item-'. $i .'" value="'. $i .'"' : ''; - + $output .= ''; $output .= wp_get_nav_menu_item( $menu_item, $object_type, $object ); $output .= wp_get_nav_menu_sub_items( $menu_item->ID, $object_type, $object, $context ); @@ -307,7 +307,7 @@ function wp_nav_menu_get_items( $menu_items, $object_type, $object = null, $cont ++$i; } } - + return $output; } @@ -323,7 +323,7 @@ function wp_nav_menu_get_items( $menu_items, $object_type, $object = null, $cont */ function wp_get_nav_menu_sub_items( $childof, $object_type, $object = null, $context = 'frontend' ) { $args = array( 'child_of' => $childof, 'parent' => $childof, 'hide_empty' => false, ); - + switch ( $object_type ) { case 'post_type': $hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) ); @@ -334,7 +334,7 @@ function wp_get_nav_menu_sub_items( $childof, $object_type, $object = null, $con $sub_menu_items = array(); } break; - + case 'taxonomy': if ( is_taxonomy_hierarchical( $object ) ) { $sub_menu_items = get_terms( $object, $args ); @@ -342,12 +342,12 @@ function wp_get_nav_menu_sub_items( $childof, $object_type, $object = null, $con $sub_menu_items = array(); } break; - + default: $sub_menu_items = array(); break; } - + $output = ''; $i = 1; if ( !empty($sub_menu_items) && !is_wp_error($sub_menu_items) ) { diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 515742514..080552095 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -557,7 +557,7 @@ function deactivate_plugins( $plugins, $silent = false ) { * * @param string|array $plugins * @param string $redirect Redirect to page after successful activation. - * @param bool $network_wide Whether to enable the plugin for all sites in the network. + * @param bool $network_wide Whether to enable the plugin for all sites in the network. * @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation. */ function activate_plugins($plugins, $redirect = '', $network_wide) { diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index e148c513c..86d5a49f1 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -270,7 +270,7 @@ function bulk_edit_posts( $post_data = null ) { else unset($post_data['post_category']); } - + $tax_input = array(); if ( isset($post_data['tax_input'])) { foreach ( $post_data['tax_input'] as $tax_name => $terms ) { @@ -278,7 +278,7 @@ function bulk_edit_posts( $post_data = null ) { continue; $taxonomy = get_taxonomy( $tax_name ); if ( $taxonomy->hierarchical ) - $tax_input[$tax_name] = array_map( 'absint', $terms ); + $tax_input[$tax_name] = array_map( 'absint', $terms ); else { $tax_input[$tax_name] = preg_replace( '/\s*,\s*/', ',', rtrim( trim($terms), ' ,' ) ); $tax_input[$tax_name] = explode(',', $tax_input[$tax_name]); @@ -314,14 +314,14 @@ function bulk_edit_posts( $post_data = null ) { $locked[] = $post_ID; continue; } - + $tax_names = get_object_taxonomies( get_post($post_ID) ); - + if ( isset($new_cats) && in_array( 'category', $tax_names ) ) { $cats = (array) wp_get_post_categories($post_ID); $post_data['post_category'] = array_unique( array_merge($cats, $new_cats) ); } - + foreach ( $tax_names as $tax_name ) { if( isset( $tax_input[$tax_name]) ) { $taxonomy = get_taxonomy( $tax_name ); diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index c76b3367f..712252d08 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -862,15 +862,15 @@ function inline_edit_row( $screen ) { $flat_taxonomies = array(); foreach ( $taxonomy_names as $taxonomy_name ) { $taxonomy = get_taxonomy( $taxonomy_name); - + if( !$taxonomy->show_ui ) continue; - + if( $taxonomy->hierarchical ) $hierarchical_taxonomies[] = $taxonomy; - else + else $flat_taxonomies[] = $taxonomy; } - + $columns = wp_manage_posts_columns($screen); $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) ); $col_count = count($columns) - count($hidden); @@ -965,7 +965,7 @@ function inline_edit_row( $screen ) {
        - + label) ?> @@ -2973,7 +2973,7 @@ function get_hidden_meta_boxes($screen) { * @global $wp_settings_sections Storage array of all settings sections added to admin pages * @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags. - * @param string $title Formatted title of the section. Shown as the heading for the section. + * @param string $title Formatted title of the section. Shown as the heading for the section. * @param string $callback Function that echo's out content for the section heading. * @param string $page The slug-name of the settings page on which to show the section (general, reading, writing, ...). */ @@ -2999,7 +2999,7 @@ function add_settings_section($id, $title, $callback, $page) { * * The $callback argument should be the name of a function that echoes out the * html input tags for this setting field. Use get_option() to retrive existing - * values to show. + * values to show. * * @since 2.7.0 * @@ -3102,7 +3102,7 @@ function do_settings_fields($page, $section) { * page is first accessed. * * @global array $wp_settings_errors Storage array of errors registered during this pageload - * + * * @param string $setting Slug title of the setting to which this error applies * @param string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output. * @param string $message The formatted message text to display to the user (will be shown inside styled
        and

        ) @@ -3129,7 +3129,7 @@ function add_settings_error( $setting, $code, $message, $type = 'error' ) { * Checks the $wp_settings_errors array for any errors declared during the current * pageload and returns them. * - * If changes were just submitted ($_GET['updated']) and settings errors were saved + * If changes were just submitted ($_GET['updated']) and settings errors were saved * to the 'settings_errors' transient then those errors will be returned instead. This * is used to pass errors back across pageloads. * @@ -3177,7 +3177,7 @@ function get_settings_errors( $setting = '', $sanitize = FALSE ) { * Display settings errors registered by add_settings_error() * * Part of the Settings API. Outputs a

        for each error retrieved by get_settings_errors(). - * + * * This is called automatically after a settings page based on the Settings API is submitted. * Errors should be added during the validation callback function for a setting defined in register_setting() * @@ -3300,12 +3300,12 @@ function the_post_password() { */ function favorite_actions( $screen = null ) { global $post_type_object; - + $default_action = false; - + if ( is_string($screen) ) $screen = convert_to_screen($screen); - + if ( isset($post_type_object) ) { switch ( $screen->id ) { case $post_type_object->name: @@ -3316,7 +3316,7 @@ function favorite_actions( $screen = null ) { break; } } - + if ( !$default_action ) { switch ( $screen->id ) { case 'upload': diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 27baee9e7..87c1f6d8c 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -265,8 +265,8 @@ function wp_install_defaults($user_id) { 'post_content_filtered' => '' )); - // Setup default widgets for default theme. - update_option( 'widget_search', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) ); + // Setup default widgets for default theme. + update_option( 'widget_search', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) ); update_option( 'widget_recent-posts', array ( 2 => array ( 'title' => '', 'number' => 5 ), '_multiwidget' => 1 ) ); update_option( 'widget_recent-comments', array ( 2 => array ( 'title' => '', 'number' => 5 ), '_multiwidget' => 1 ) ); update_option( 'widget_archives', array ( 2 => array ( 'title' => '', 'count' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) ); @@ -1109,7 +1109,7 @@ function upgrade_300() { if ( $wp_current_db_version < 12751 ) { populate_roles_300(); - if ( is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false ) + if ( is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false ) add_site_option( 'siteurl', '' ); } } diff --git a/wp-admin/js/common.dev.js b/wp-admin/js/common.dev.js index f9a8ae2ce..acddcc4bb 100644 --- a/wp-admin/js/common.dev.js +++ b/wp-admin/js/common.dev.js @@ -289,13 +289,13 @@ jQuery(document).ready( function($) { el.selectionStart = el.selectionEnd = selStart + 1; this.scrollTop = scroll; } - + if ( e.stopPropagation ) e.stopPropagation(); if ( e.preventDefault ) e.preventDefault(); }); - + $('#newcontent').blur(function(e) { if ( this.lastKey && 9 == this.lastKey ) this.focus(); diff --git a/wp-admin/js/inline-edit-post.dev.js b/wp-admin/js/inline-edit-post.dev.js index 6bf2825b0..2bb3547b1 100644 --- a/wp-admin/js/inline-edit-post.dev.js +++ b/wp-admin/js/inline-edit-post.dev.js @@ -158,7 +158,7 @@ inlineEditPost = { $('textarea.tax_input_'+taxname, editRow).suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } ); } }); - + // handle the post status status = $('._status', rowData).text(); diff --git a/wp-admin/js/nav-menu.dev.js b/wp-admin/js/nav-menu.dev.js index 4eae56771..7918411f5 100644 --- a/wp-admin/js/nav-menu.dev.js +++ b/wp-admin/js/nav-menu.dev.js @@ -33,11 +33,11 @@ function wp_edit_menu_item( id ) { var item_description = jQuery('#menu-item-description' + id).val(); var item_classes = jQuery('#menu-item-classes' + id).val(); var item_xfn = jQuery('#menu-item-xfn' + id).val(); - + // Only allow custom links to be editable. if ( 'custom' != item_type ) jQuery( '#edit-menu-item-url' ).attr('disabled', 'disabled' ); - + // Populate the fields for thickbox jQuery( '#edit-menu-item-id' ).val(id); jQuery( '#edit-menu-item-title' ).val(item_title); @@ -48,7 +48,7 @@ function wp_edit_menu_item( id ) { jQuery( '#edit-menu-item-description' ).val(item_description); jQuery( '#edit-menu-item-classes' ).val(item_classes); jQuery( '#edit-menu-item-xfn' ).val(item_xfn); - + // focus jQuery( '#edit-menu-item-title' ).focus(); }; @@ -65,7 +65,7 @@ function wp_update_menu_item() { var item_description = jQuery('#edit-menu-item-description').val(); var item_classes = jQuery('#edit-menu-item-classes').val(); var item_xfn = jQuery('#edit-menu-item-xfn').val(); - + // update menu item settings jQuery('.menu #menu-item' + id).find('span.item-title').html(item_title); jQuery('.menu #menu-item-title' + id).val(item_title); @@ -75,7 +75,7 @@ function wp_update_menu_item() { jQuery('.menu #menu-item-description' + id).val(item_description); jQuery('.menu #menu-item-classes' + id).val(item_classes); jQuery('.menu #menu-item-xfn' + id).val(item_xfn); - + jQuery('.menu #menu-item' + id + ' dt:first').animate( { backgroundColor: '#FFFF33' }, { duration: 'normal', complete: function() { jQuery(this).css( 'backgroundColor', '' ); }}); } @@ -86,7 +86,7 @@ function wp_update_menu_item() { */ function wp_remove_menu_item( o ) { var todelete = document.getElementById('menu-item' + o); - + if ( todelete ) { // Give some feedback to the user jQuery( todelete ).find('dt').each(function(){ @@ -114,16 +114,16 @@ function wp_remove_menu_item( o ) { function wp_add_item_to_menu( item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ) { var randomnumber = wp_get_unique_menu_id(); var hidden = wp_get_hidden_inputs( randomnumber, item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ); - + // Adds the item in the queue jQuery('.menu').append(''); - + // Give some feedback to the user jQuery( '.menu #menu-item' + randomnumber + ' dt:first' ).animate( { backgroundColor: '#FFFF33' }, { duration: 'normal', complete: function() { jQuery(this).css( 'backgroundColor', '' ); }}); - + // Enable drag-n-drop wp_drag_and_drop(); - + // Reload thickbox tb_init('a.thickbox, area.thickbox, input.thickbox'); }; @@ -136,15 +136,15 @@ function wp_add_item_to_menu( item_db_id, item_object_id, item_type, item_append function wp_add_checked_items_to_menu( button ) { // Grab checked items var items = jQuery(button).siblings('.list-wrap').find(':checked'); - + // If nothing was checked, cancel if ( 0 == items.length ) return false; - + // Loop through each item, grab it's hidden data and add it to the menu. jQuery(items).each(function(){ var item_type = jQuery(this).parent().siblings('.menu-item-type').val(); - + if ( 'custom' == item_type ) { var item_attr_title = jQuery(this).parent().siblings('.menu-item-attr-title').val(); var item_target = jQuery(this).parent().siblings('.menu-item-target').val(); @@ -156,7 +156,7 @@ function wp_add_checked_items_to_menu( button ) { var item_classes = ''; var item_xfn = ''; }; - + var item_db_id = jQuery(this).parent().siblings('.menu-item-db-id').val(); var item_object_id = jQuery(this).parent().siblings('.menu-item-object-id').val(); var item_append = jQuery(this).parent().siblings('.menu-item-append').val(); @@ -164,14 +164,14 @@ function wp_add_checked_items_to_menu( button ) { var item_title = jQuery(this).parent().siblings('.menu-item-title').val(); var item_url = jQuery(this).parent().siblings('.menu-item-url').val(); var item_description = jQuery(this).parent().siblings('.menu-item-description').val(); - + if ( undefined == item_description ) { item_description = ''; }; - + // Add the menu item to the menu wp_add_item_to_menu( item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ); - + // uncheck the menu item in the list jQuery(this).attr( 'checked', false ); }); @@ -204,7 +204,7 @@ function wp_drag_and_drop() { drop: function(e, ui) { var li = jQuery(this).parent(); var child = !jQuery(this).hasClass('dropzone'); - + // Append UL to first child if ( child && li.children('ul').length == 0 ) { li.append( '
        - + -
        +
        'display name' @@ -539,14 +539,14 @@ switch ( $action ) { $order2 = ''; if ( $order_by == $column_id ) $order2 = ($order == 'DESC') ? 'ASC' : 'DESC'; - + $column_link .= esc_url(add_query_arg( array('order' => $order2, 'paged' => $pagenum, 'sortby' => $column_id ), remove_query_arg( array('action', 'updated'), $_SERVER['REQUEST_URI'] ) ) ); $column_link .= "'>{$column_display_name}"; $col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link; ?> - + @@ -639,7 +639,7 @@ switch ( $action ) { else $date = 'Y/m/d \<\b\r \/\> g:i:s a'; echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __("Never") : mysql2date( __( $date ), $blog['last_updated'] ); ?> - + diff --git a/wp-admin/ms-users.php b/wp-admin/ms-users.php index aeb612488..cee2e10ad 100644 --- a/wp-admin/ms-users.php +++ b/wp-admin/ms-users.php @@ -195,7 +195,7 @@ if ( isset($_GET['updated']) && $_GET['updated'] == 'true' ) { ?>
        diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index ba737dc7c..54c1550be 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -62,10 +62,10 @@ switch ( $action ) { $nav_menu_selected_id = 0; } break; - + case 'update': check_admin_referer( 'update-nav_menu' ); - + // Add Menu if ( isset($_POST['create-menu']) ) { if ( current_theme_supports('nav-menus') ) { @@ -91,15 +91,15 @@ switch ( $action ) { $args = array( 'name' => $_POST['menu-name'], 'slug' => null, 'description' => $old_nav_menu['description'], 'parent' => $old_nav_menu['parent'], ); $new_nav_menu = wp_update_term( $nav_menu_selected_id, 'nav_menu', $args ); } - + // Update menu items $update_nav_items = isset( $_POST['li-count'] ) ? (int) $_POST['li-count'] : 0; $update_nav_menu = is_nav_menu( $nav_menu_selected_id ); - + if ( !is_wp_error($update_nav_menu) ) { $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') ); $parent_menu_ids = array(); - + // Loop through all POST variables for ( $k = 0; $k < $update_nav_items; $k++ ) { $menu_item_db_id = isset( $_POST['menu-item-db-id'][$k] ) ? $_POST['menu-item-db-id'][$k] : 0; @@ -108,7 +108,7 @@ switch ( $action ) { $menu_item_position = isset( $_POST['menu-item-position'][$k] ) ? $_POST['menu-item-position'][$k] : 0; $menu_item_type = isset( $_POST['menu-item-type'][$k] ) ? $_POST['menu-item-type'][$k] : 'custom'; $menu_item_append = isset( $_POST['menu-item-append'][$k] ) ? $_POST['menu-item-append'][$k] : 'custom'; - + $menu_item_title = isset( $_POST['menu-item-title'][$k] ) ? $_POST['menu-item-title'][$k] : ''; $menu_item_url = isset( $_POST['menu-item-url'][$k] ) ? $_POST['menu-item-url'][$k] : ''; $menu_item_description = isset( $_POST['menu-item-description'][$k] ) ? $_POST['menu-item-description'][$k]: ''; @@ -116,11 +116,11 @@ switch ( $action ) { $menu_item_target = isset( $_POST['menu-item-target'][$k] ) ? $_POST['menu-item-target'][$k] : 0; $menu_item_classes = isset( $_POST['menu-item-classes'][$k] ) ? $_POST['menu-item-classes'][$k] : ''; $menu_item_xfn = isset( $_POST['menu-item-xfn'][$k] ) ? $_POST['menu-item-xfn'][$k] : ''; - + // Menu item title can't be blank if ( '' == $menu_item_title ) continue; - + // Populate the menu item $post = array( 'post_status' => 'publish', 'post_type' => 'nav_menu_item', 'post_author' => $user_ID, 'ping_status' => 0, 'post_parent' => $menu_item_parent_id, 'menu_order' => $menu_item_position, @@ -136,7 +136,7 @@ switch ( $action ) { unset( $menu_items[$menu_item_db_id] ); } $parent_menu_ids[$k] = $menu_item_db_id; - + // @todo sanitize type append and ID. update_post_meta( $menu_item_db_id, 'menu_item_type', $menu_item_type ); update_post_meta( $menu_item_db_id, 'menu_item_append', $menu_item_append ); @@ -145,11 +145,11 @@ switch ( $action ) { // @todo handle sanitizing multiple classes separated by whitespace. update_post_meta( $menu_item_db_id, 'menu_item_classes', sanitize_html_class($menu_item_classes) ); update_post_meta( $menu_item_db_id, 'menu_item_xfn', sanitize_html_class($menu_item_xfn) ); - + // @todo: only save custom link urls. update_post_meta( $menu_item_db_id, 'menu_item_url', esc_url_raw( $menu_item_url ) ); } - + // Remove menu items from the menu that weren't in $_POST if ( !empty( $menu_items ) ) { foreach ( array_keys( $menu_items ) as $menu_item_id ) { @@ -177,7 +177,7 @@ if ( !$recently_edited && is_nav_menu($nav_menu_selected_id) ) { // Else try to grab the first menu from the menus list } elseif ( 0 == $nav_menu_selected_id && ! empty($nav_menus) ) { - $nav_menu_selected_id = $nav_menus[0]->term_id; + $nav_menu_selected_id = $nav_menus[0]->term_id; } // Update the user's setting @@ -214,7 +214,7 @@ require_once( 'admin-header.php' ); term_id ) echo '
      • '. esc_html( $_nav_menu->name ) .''. $sep .'
      • '; else @@ -232,16 +232,16 @@ require_once( 'admin-header.php' ); - +
        @@ -252,9 +252,9 @@ require_once( 'admin-header.php' );

        diff --git a/wp-admin/network.php b/wp-admin/network.php index 8fe9058f9..9a45f4f67 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -278,7 +278,7 @@ define( 'BLOG_ID_CURRENT_SITE', 1 ); echo "\ndefine( '$c', '$v' );"; } ?> - diff --git a/wp-admin/options.php b/wp-admin/options.php index 77ac4b54e..ef87cad1a 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -29,7 +29,7 @@ if ( empty($option_page) ) // This is for back compat and will eventually be rem if ( !current_user_can('manage_options') ) wp_die(__('Cheatin’ uh?')); - + if ( is_multisite() && !is_super_admin() && 'update' != $action ) wp_die(__('Cheatin’ uh?')); diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 9f0623908..f94ee812f 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -96,21 +96,21 @@ if ( !empty($action) ) { exit; break; case 'update-selected' : - + check_admin_referer( 'bulk-manage-plugins' ); - + if ( isset( $_GET['plugins'] ) ) $plugins = explode( ',', $_GET['plugins'] ); elseif ( isset( $_POST['checked'] ) ) $plugins = (array) $_POST['checked']; else $plugins = array(); - + $title = __( 'Upgrade Plugins' ); $parent_file = 'plugins.php'; require_once( 'admin-header.php' ); - + echo '
        '; screen_icon(); echo '

        ' . esc_html( $title ) . '

        '; diff --git a/wp-admin/tools.php b/wp-admin/tools.php index 5feeecfda..1b9308b43 100644 --- a/wp-admin/tools.php +++ b/wp-admin/tools.php @@ -90,13 +90,13 @@ endif; $cats = get_taxonomy('category'); $tags = get_taxonomy('post_tag'); -if ( current_user_can($cats->manage_cap) || current_user_can($tags->manage_cap) ) : ?> -
        +if ( current_user_can($cats->manage_cap) || current_user_can($tags->manage_cap) ) : ?> +

        -

        categories to tags, or tags to categories.'), 'admin.php?import=wp-cat2tag', 'admin.php?import=wp-cat2tag&step=3'); ?>

        -
        +

        categories to tags, or tags to categories.'), 'admin.php?import=wp-cat2tag', 'admin.php?import=wp-cat2tag&step=3'); ?>

        +
        diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 00999db8d..4740bd3b1 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -267,7 +267,7 @@ function list_theme_updates() { $theme_data) { $screenshot = $theme_data->{'Theme Root URI'} . '/' . $stylesheet . '/' . $theme_data->Screenshot; - + echo " diff --git a/wp-admin/update.php b/wp-admin/update.php index cbe2578c4..43f6e13f8 100644 --- a/wp-admin/update.php +++ b/wp-admin/update.php @@ -42,7 +42,7 @@ if ( isset($_GET['action']) ) { $upgrader->bulk_upgrade( $plugins ); iframe_footer(); - + } elseif ( 'upgrade-plugin' == $action ) { if ( ! current_user_can('update_plugins') ) wp_die(__('You do not have sufficient permissions to update plugins for this blog.')); diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 3ced08a0d..ce2d1f4d9 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -396,7 +396,7 @@ if ( isset($_GET['detached']) ) { ?> if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) ) echo esc_html( strtoupper( $matches[1] ) ); else - echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) ); + echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) ); ?>
        diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 6d9b84e51..2f1962cdc 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -86,7 +86,7 @@ foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', add_filter( $filter, 'esc_html' ); } -// Format titles +// Format titles foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title' ) as $filter ) { add_filter( $filter, 'wptexturize' ); add_filter( $filter, 'strip_tags' ); diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 0dc3db593..0f67866c1 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -1029,7 +1029,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget { } function _get_current_taxonomy($instance) { - if ( !empty($instance['taxonomy']) && is_taxonomy($instance['taxonomy']) ) + if ( !empty($instance['taxonomy']) && is_taxonomy($instance['taxonomy']) ) return $instance['taxonomy']; return 'post_tag'; @@ -1047,21 +1047,21 @@ class WP_Widget_Tag_Cloud extends WP_Widget { $widget_ops = array( 'description' => __('Use this widget to add one of your navigation menus as a widget.') ); parent::WP_Widget( 'nav_menu', __('Navigation Menu'), $widget_ops ); } - + function widget($args, $instance) { // Get menu $nav_menu = wp_get_nav_menu_object( $instance['nav_menu'] ); - + if ( !$nav_menu ) - return; - + return; + echo $args['before_widget']; - + if ( isset($instance['title']) ) echo $args['before_title'] . $instance['title'] . $args['after_title']; - + wp_nav_menu( array( 'menu' => $nav_menu ) ); - + echo $args['after_widget']; } @@ -1074,10 +1074,10 @@ class WP_Widget_Tag_Cloud extends WP_Widget { function form( $instance ) { $title = isset( $instance['title'] ) ? $instance['title'] : ''; $nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : ''; - + // Get menus $menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) ); - + // If no menus exists, direct the user to go and create some. if ( !$menus ) { echo '

        '. sprintf( __('No menus have been created yet. Create some.'), admin_url('nav-menus.php') ) .'

        '; diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 6cac389f3..65fef4d39 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -756,7 +756,7 @@ function sanitize_user( $username, $strict = false ) { * Keys are used as internal identifiers. They should be lowercase ASCII. Dashes and underscores are allowed. * * @since 3.0.0 - * + * * @param string $key String key * @return string Sanitized key */ diff --git a/wp-includes/functions.php b/wp-includes/functions.php index c4c373373..2e7588c9b 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1825,7 +1825,7 @@ function is_blog_installed() { if ( defined( 'CUSTOM_USER_TABLE' ) && CUSTOM_USER_TABLE == $table ) continue; if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table ) - continue; + continue; // If visiting repair.php, return true and let it take over. if ( defined('WP_REPAIRING') ) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 1c274477f..289ad131d 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -316,7 +316,7 @@ function load_textdomain( $domain, $mofile ) { /** * Unloads translations for a domain - * + * * @since 3.0.0 * @param string $domain Textdomain to be unloaded * @return bool Whether textdomain was unloaded diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 72c4d8545..d2e76b844 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -2059,7 +2059,7 @@ function wp_ajaxurl() { * via the get_shortlink filter. * * @since 3.0.0. - * + * * @param int $id A post or blog id. Default is 0, which means the current post or blog. * @param string $contex Whether the id is a 'blog' id, 'post' id, or 'media' id. If 'post', the post_type of the post is consulted. If 'query', the current query is consulted to determine the id and context. Default is 'post'. * @param bool $allow_slugs Whether to allow post slugs in the shortlink. It is up to the plugin how and whether to honor this. diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index f0a68db4f..e0b85dab5 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -25,14 +25,14 @@ function wp_nav_menu( $args = array() ) { $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'menu_class' => 'menu', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before_link' => '', 'after_link' => '', 'before_title' => '', 'after_title' => '', ); - + $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'wp_nav_menu_args', $args ); $args = (object) $args; // Get the nav menu $menu = wp_get_nav_menu_object( $args->menu ); - + // If we couldn't find a menu based off the name, id or slug, // get the first menu that has items. if ( !$menu ) { @@ -51,7 +51,7 @@ function wp_nav_menu( $args = array() ) { if ( 'div' == $args->container ) { $class = $args->container_class ? ' class="' . esc_attr($args->container_class) . '"' : ''; - + if ( is_nav_menu($menu) ) { $nav_menu .= ''; - + $nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args ); if ( $args->echo ) @@ -85,25 +85,25 @@ function wp_nav_menu( $args = array() ) { function wp_get_nav_menu( $args = array() ) { $defaults = array( 'menu' => '', 'menu_class' => 'menu', 'context' => 'frontend', 'fallback_cb' => '', 'before_link' => '', 'after_link' => '', 'before_title' => '', 'after_title' => '', ); - + $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'wp_get_nav_menu_args', $args ); $args = (object) $args; - + // Variable setup $nav_menu = ''; $items = ''; $current_parent = 0; $parent_stack = array(); $parent_menu_order = array(); - + // Get the menu object $menu = wp_get_nav_menu_object( $args->menu ); - + // If the menu exists, get it's items. if ( $menu && !is_wp_error($menu) ) $menu_items = wp_get_nav_menu_items( $menu->term_id, 'backend' ); - + // If no menu was found or if the menu has no items, call the fallback_cb if ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) ) ) { if ( function_exists($args->fallback_cb) ) { @@ -111,7 +111,7 @@ function wp_get_nav_menu( $args = array() ) { return call_user_func( $args->fallback_cb, $_args ); } } - + foreach ( $menu_items as $key => $menu_item ) { // Set up the $menu_item variables $menu_item = wp_setup_nav_menu_item( $menu_item, 'frontend' ); @@ -119,10 +119,10 @@ function wp_get_nav_menu( $args = array() ) { $type = $menu_item->append; $maybe_value = 'frontend' == $args->context ? '' : ' value="'. $menu_item->ID .'"'; $classes = 'frontend' == $args->context ? ' class="menu-item-type-'. $type . $menu_item->li_class .'"' : ''; - + $items .= ''; } } - + // CSS class $ul_class = $args->menu_class ? ' class="'. $args->menu_class .'"' : ''; $nav_menu .= ''; - + // Allow plugins to hook into the menu to add their own
      • 's if ( 'frontend' == $args->context ) { $items = apply_filters( 'wp_nav_menu_items', $items, $args ); @@ -154,9 +154,9 @@ function wp_get_nav_menu( $args = array() ) { } else { $nav_menu .= $items; } - + $nav_menu .= '
      '; - + return apply_filters( 'wp_get_nav_menu', $nav_menu ); } @@ -179,15 +179,15 @@ function wp_get_nav_menu_item( $menu_item, $context = 'frontend', $args = array( $attributes .= ( isset($menu_item->classes) && '' != $menu_item->classes ) ? ' class="'. esc_attr($menu_item->classes) .'"' : ''; $attributes .= ( isset($menu_item->xfn) && '' != $menu_item->xfn ) ? ' rel="'. esc_attr($menu_item->xfn) .'"' : ''; $attributes .= ( isset($menu_item->url) && '' != $menu_item->url ) ? ' href="'. esc_attr($menu_item->url) .'"' : ''; - + $output .= esc_html( $args->before_link ); $output .= ''; $output .= esc_html( $args->before_title . $menu_item->title . $args->after_title ); $output .= ''; $output .= esc_html( $args->after_link ); - + break; - + case 'backend': $output .= '
      '; $output .= ''. esc_html($menu_item->title) .''; @@ -204,13 +204,13 @@ function wp_get_nav_menu_item( $menu_item, $context = 'frontend', $args = array( $label = $menu_item->append; } $output .= ''. esc_html($label) .''; - + // Actions $output .= ''. __('Edit') .' | '; $output .= ''. __('Delete') .''; - + $output .= '
      '; - + // Menu Item Settings $output .= ''; $output .= ''; @@ -226,11 +226,11 @@ function wp_get_nav_menu_item( $menu_item, $context = 'frontend', $args = array( $output .= ''; $output .= ''; break; - + case 'custom': $menu_id = 'menu-item-' . $menu_item->db_id; $output .= ''; - + // Menu item hidden fields $output .= ''; $output .= ''; @@ -245,12 +245,12 @@ function wp_get_nav_menu_item( $menu_item, $context = 'frontend', $args = array( $output .= ''; $output .= ''; break; - + case 'taxonomy': case 'post_type': $menu_id = 'menu-item-' . $menu_item->db_id; $output .= ''; - + // Menu item hidden fields $output .= ''; $output .= ''; @@ -262,7 +262,7 @@ function wp_get_nav_menu_item( $menu_item, $context = 'frontend', $args = array( $output .= ''; break; } - + return $output; } ?> \ No newline at end of file diff --git a/wp-includes/nav-menu.php b/wp-includes/nav-menu.php index 7d017673b..c9e73de40 100644 --- a/wp-includes/nav-menu.php +++ b/wp-includes/nav-menu.php @@ -118,21 +118,21 @@ function wp_get_nav_menus() { * @since 3.0.0 * * @param string $menu menu name, id, or slug - * @param string $args + * @param string $args * @return mixed $items array of menu items, else false. */ function wp_get_nav_menu_items( $menu, $args = array() ) { $menu = wp_get_nav_menu_object( $menu ); - + if ( !$menu ) return false; - + $items = get_objects_in_term( $menu->term_id, 'nav_menu' ); if ( ! empty( $items ) ) { $defaults = array( 'orderby' => 'menu_order', 'post_type' => 'nav_menu_item', 'post_status' => 'publish', 'output' => ARRAY_A, 'output_key' => 'menu_order' ); $args = wp_parse_args( $args, $defaults ); - if ( count( $items ) > 1 ) + if ( count( $items ) > 1 ) $args['include'] = implode( ',', $items ); else $args['include'] = $items[0]; @@ -164,7 +164,7 @@ function wp_get_nav_menu_items( $menu, $args = array() ) { */ function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_object = '' ) { global $wp_query; - + switch ( $menu_item_type ) { case 'frontend': $menu_item->db_id = (int) $menu_item->ID; @@ -173,26 +173,26 @@ function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_ $menu_item->type = get_post_meta( $menu_item->ID, 'menu_item_type', true ); $menu_item->append = get_post_meta( $menu_item->ID, 'menu_item_append', true ); - + $menu_item->title = $menu_item->post_title; $menu_item->url = get_post_meta( $menu_item->ID, 'menu_item_url', true ); $menu_item->target = get_post_meta( $menu_item->ID, 'menu_item_target', true ); - + $menu_item->attr_title = strip_tags( $menu_item->post_excerpt ); $menu_item->description = strip_tags( $menu_item->post_content ); - + $menu_item->classes = get_post_meta( $menu_item->ID, 'menu_item_classes', true );; $menu_item->xfn = get_post_meta( $menu_item->ID, 'menu_item_xfn', true ); $menu_item->li_class = ( $menu_item->object_id == $wp_query->get_queried_object_id() ) ? ' current_page_item' : ''; break; - + case 'custom': $menu_item->db_id = (int) $menu_item->ID; $menu_item->object_id = (int) $menu_item->ID; $menu_item->parent_id = (int) $menu_item->post_parent; $menu_item->type = 'custom'; //$menu_item_type $menu_item->append = 'custom'; - + $menu_item->attr_title = strip_tags( $menu_item->post_excerpt ); $menu_item->description = strip_tags( $menu_item->post_content ); @@ -200,31 +200,31 @@ function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_ $menu_item->url = get_post_meta( $menu_item->ID, 'menu_item_url', true ); $menu_item->target = get_post_meta( $menu_item->ID, 'menu_item_target', true ); break; - + case 'post_type': $menu_item->db_id = 0; $menu_item->object_id = (int) $menu_item->ID; $menu_item->parent_id = (int) $menu_item->post_parent; $menu_item->type = $menu_item_type; - + $object = get_post_type_object( $menu_item_object ); $menu_item->append = $object->name; $menu_item->title = $menu_item->post_title; $menu_item->url = get_permalink( $menu_item->ID ); $menu_item->target = '_self'; - + $menu_item->attr_title = ''; $menu_item->description = strip_tags( $menu_item->post_content ); break; - + case 'taxonomy': $menu_item->ID = $menu_item->term_id; $menu_item->db_id = 0; $menu_item->object_id = (int) $menu_item->term_id; $menu_item->parent_id = (int) $menu_item->parent; $menu_item->type = $menu_item_type; - + $object = get_taxonomy( $menu_item_object ); $menu_item->append = $object->name; @@ -238,7 +238,7 @@ function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_ $menu_item->classes = get_post_meta( $menu_item->ID, 'menu_item_classes', true ); $menu_item->xfn = get_post_meta( $menu_item->ID, 'menu_item_xfn', true ); - + return $menu_item; } ?> \ No newline at end of file diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 175eb496a..0cc14e9f4 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -166,7 +166,7 @@ function cache_users( $users ) { $list = implode(',', $clean); $results = $wpdb->get_results("SELECT * FROM $wpdb->users WHERE ID IN ($list)"); - + _fill_many_users($results); } endif; diff --git a/wp-includes/post.php b/wp-includes/post.php index b2ef1408d..5313d14dc 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2930,12 +2930,12 @@ function &get_pages($args = '') { extract( $r, EXTR_SKIP ); $number = (int) $number; $offset = (int) $offset; - + // Make sure the post type is hierarchical $hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) ); if ( !in_array( $post_type, $hierarchical_post_types ) ) return false; - + // Make sure we have a valid post status if ( !in_array($post_status, get_post_stati()) ) return false; @@ -3031,7 +3031,7 @@ function &get_pages($args = '') { if ( $parent >= 0 ) $where .= $wpdb->prepare(' AND post_parent = %d ', $parent); - + $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; @@ -3178,7 +3178,7 @@ function wp_insert_attachment($object, $file = false, $parent = 0) { $post_category = array( get_option('default_category') ); else $post_category = array(); - } + } // Are we updating or creating? if ( !empty($ID) ) { @@ -3814,7 +3814,7 @@ function get_lastpostmodified($timezone = 'server') { $lastpostmodified = wp_cache_get( "lastpostmodified:$timezone", 'timeinfo' ); if ( $lastpostmodified ) return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone ); - + switch ( strtolower($timezone) ) { case 'gmt': $lastpostmodified = $wpdb->get_var("SELECT post_modified_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1"); @@ -3826,13 +3826,13 @@ function get_lastpostmodified($timezone = 'server') { $lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1"); break; } - + $lastpostdate = get_lastpostdate($timezone); if ( $lastpostdate > $lastpostmodified ) $lastpostmodified = $lastpostdate; - if ( $lastpostmodified ) - wp_cache_set( "lastpostmodified:$timezone", $lastpostmodified, 'timeinfo' ); + if ( $lastpostmodified ) + wp_cache_set( "lastpostmodified:$timezone", $lastpostmodified, 'timeinfo' ); return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone ); } diff --git a/wp-includes/query.php b/wp-includes/query.php index e8e995035..19d85c6b3 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -224,9 +224,9 @@ function is_tag( $slug = '' ) { * Whether the current query is for the given taxonomy and/or term. * * If no taxonomy argument is set, returns true if any taxonomy is queried. - * If the taxonomy argument is passed but no term argument, returns true + * If the taxonomy argument is passed but no term argument, returns true * if the taxonomy or taxonomies in the argument are being queried. - * If both taxonomy and term arguments are passed, returns true + * If both taxonomy and term arguments are passed, returns true * if the current query is for a term contained in the terms argument * which has a taxonomy contained in the taxonomy argument. * @@ -253,9 +253,9 @@ function is_tax( $taxonomy = '', $term = '' ) { if ( empty( $term ) ) // Only a Taxonomy provided return isset($queried_object->taxonomy) && count( $tax_array ) && in_array($queried_object->taxonomy, $tax_array); - return isset($queried_object->term_id) && + return isset($queried_object->term_id) && count(array_intersect( - array($queried_object->term_id, $queried_object->name, $queried_object->slug), + array($queried_object->term_id, $queried_object->name, $queried_object->slug), $term_array )); } diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index c7b72920b..31ccd761f 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -1780,10 +1780,10 @@ class WP_Rewrite { } else { $siteurl = get_option( 'siteurl' ); $siteurl_len = strlen( $siteurl ); - if ( substr( WP_CONTENT_URL, 0, $siteurl_len ) == $siteurl && strlen( WP_CONTENT_URL ) > $siteurl_len ) + if ( substr( WP_CONTENT_URL, 0, $siteurl_len ) == $siteurl && strlen( WP_CONTENT_URL ) > $siteurl_len ) $content_path = substr( WP_CONTENT_URL, $siteurl_len + 1 ); else - $content_path = 'wp-content'; + $content_path = 'wp-content'; $rules = ' diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 9dd536c29..57be9adf8 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -160,7 +160,7 @@ function get_taxonomy( $taxonomy ) { */ function is_taxonomy( $taxonomy ) { global $wp_taxonomies; - + return isset($wp_taxonomies[$taxonomy]); } @@ -261,12 +261,12 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { } if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') ) { - $args['rewrite'] = wp_parse_args($args['rewrite'], array( - 'slug' => sanitize_title_with_dashes($taxonomy), - 'with_front' => true, - )); - $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); - $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); + $args['rewrite'] = wp_parse_args($args['rewrite'], array( + 'slug' => sanitize_title_with_dashes($taxonomy), + 'with_front' => true, + )); + $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); + $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); } if ( is_null($args['show_ui']) ) diff --git a/wp-signup.php b/wp-signup.php index 30e64f69a..ee74795fd 100644 --- a/wp-signup.php +++ b/wp-signup.php @@ -235,7 +235,7 @@ function signup_user($user_name = '', $user_email = '', $errors = '') { $signup[ esc_html( $_POST[ 'signup_for' ] ) ] = 'checked="checked"'; else $signup[ 'blog' ] = 'checked="checked"'; - + //TODO - This doesn't seem to do anything do we really need it? $signup['user'] = isset( $signup['user'] ) ? $signup['user'] : '';