Changes from trunk/src/wp-includes/update.php at r26192 to branches/3.8/src/wp-includes/update.php at r27929
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.8/src/wp-includes/update.php
r26192 r27929 169 169 * @uses $wp_version Used to notify the WordPress version. 170 170 * 171 * @param array $extra_stats Extra statistics to report to the WordPress.org API. 171 172 * @return mixed Returns null if update is unsupported. Returns false if check is too soon. 172 173 */ 173 function wp_update_plugins( ) {174 function wp_update_plugins( $extra_stats = array() ) { 174 175 include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version 175 176 … … 210 211 $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked ); 211 212 212 if ( $time_not_changed ) {213 if ( $time_not_changed && ! $extra_stats ) { 213 214 $plugin_changed = false; 214 215 foreach ( $plugins as $file => $p ) { … … 259 260 ); 260 261 262 if ( $extra_stats ) { 263 $options['body']['update_stats'] = json_encode( $extra_stats ); 264 } 265 261 266 $url = $http_url = 'http://api.wordpress.org/plugins/update-check/1.1/'; 262 267 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) … … 300 305 * @uses $wp_version Used to notify the WordPress version. 301 306 * 307 * @param array $extra_stats Extra statistics to report to the WordPress.org API. 302 308 * @return mixed Returns null if update is unsupported. Returns false if check is too soon. 303 309 */ 304 function wp_update_themes( ) {310 function wp_update_themes( $extra_stats = array() ) { 305 311 include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version 306 312 … … 352 358 $time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time() - $last_update->last_checked ); 353 359 354 if ( $time_not_changed ) {360 if ( $time_not_changed && ! $extra_stats ) { 355 361 $theme_changed = false; 356 362 foreach ( $checked as $slug => $v ) { … … 398 404 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) 399 405 ); 406 407 if ( $extra_stats ) { 408 $options['body']['update_stats'] = json_encode( $extra_stats ); 409 } 400 410 401 411 $url = $http_url = 'http://api.wordpress.org/themes/update-check/1.1/'; … … 611 621 add_action( 'admin_init', '_maybe_update_plugins' ); 612 622 add_action( 'wp_update_plugins', 'wp_update_plugins' ); 613 add_action( 'upgrader_process_complete', 'wp_update_plugins' );623 add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 ); 614 624 615 625 add_action( 'load-themes.php', 'wp_update_themes' ); … … 618 628 add_action( 'admin_init', '_maybe_update_themes' ); 619 629 add_action( 'wp_update_themes', 'wp_update_themes' ); 620 add_action( 'upgrader_process_complete', 'wp_update_themes' );630 add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 ); 621 631 622 632 add_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' );
Note: See TracChangeset
for help on using the changeset viewer.