From 7a9f91869eb161d316590dd6bf0415e115e87ff0 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 7 May 2013 16:35:03 +0000 Subject: [PATCH] Fix usage of undeclared variables. * the_weekday_date() needs the global $currentday * ms_site_check() needs the global $current_site * media list table does not need to check for $total_orphans * upgrader has no $feedback variable, appears to be copypasta from other upgrade APIs * install_themes_feature_list() has no $features variable, return array() instead of a new return type of WP_Error see #24210. git-svn-id: https://develop.svn.wordpress.org/trunk@24189 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/class-wp-media-list-table.php | 3 +-- wp-admin/includes/class-wp-upgrader.php | 3 --- wp-admin/includes/theme-install.php | 4 +++- wp-includes/general-template.php | 2 +- wp-includes/ms-load.php | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php index c3b5faade0..7487bdb45f 100644 --- a/wp-admin/includes/class-wp-media-list-table.php +++ b/wp-admin/includes/class-wp-media-list-table.php @@ -47,8 +47,7 @@ class WP_Media_List_Table extends WP_List_Table { $type_links = array(); $_num_posts = (array) wp_count_attachments(); $_total_posts = array_sum($_num_posts) - $_num_posts['trash']; - if ( !isset( $total_orphans ) ) - $total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" ); + $total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" ); $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts)); foreach ( $matches as $type => $reals ) foreach ( $reals as $real ) diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 55c79b6574..86b5b71aae 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -1029,9 +1029,6 @@ class Core_Upgrader extends WP_Upgrader { $this->init(); $this->upgrade_strings(); - if ( !empty($feedback) ) - add_filter('update_feedback', $feedback); - // Is an update available? if ( !isset( $current->response ) || $current->response == 'latest' ) return new WP_Error('up_to_date', $this->strings['up_to_date']); diff --git a/wp-admin/includes/theme-install.php b/wp-admin/includes/theme-install.php index fd7a0adb61..63be1d7e01 100644 --- a/wp-admin/includes/theme-install.php +++ b/wp-admin/includes/theme-install.php @@ -29,6 +29,8 @@ $theme_field_defaults = array( 'description' => true, 'sections' => false, 'test * @return array */ function install_themes_feature_list() { + _deprecated_function( __FUNCTION__, '3.1', 'get_theme_feature_list()' ); + if ( !$cache = get_transient( 'wporg_theme_feature_list' ) ) set_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS ); @@ -37,7 +39,7 @@ function install_themes_feature_list() { $feature_list = themes_api( 'feature_list', array() ); if ( is_wp_error( $feature_list ) ) - return $features; + return array(); set_transient( 'wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS ); diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 2d084836f8..546d69fc6d 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1579,7 +1579,7 @@ function the_weekday() { * @param string $after Optional Output after the date. */ function the_weekday_date($before='',$after='') { - global $wp_locale, $day, $previousweekday; + global $wp_locale, $currentday, $previousweekday; $the_weekday_date = ''; if ( $currentday != $previousweekday ) { $the_weekday_date .= $before; diff --git a/wp-includes/ms-load.php b/wp-includes/ms-load.php index 6a26b9cf06..95663e518a 100644 --- a/wp-includes/ms-load.php +++ b/wp-includes/ms-load.php @@ -69,7 +69,7 @@ function wp_get_active_network_plugins() { * @return bool|string Returns true on success, or drop-in file to include. */ function ms_site_check() { - global $wpdb; + global $wpdb, $current_site; $blog = get_blog_details();