WordPress.org

Make WordPress Core

Ticket #16778: wp-includes--update.php.2.diff

File wp-includes--update.php.2.diff, 1.3 KB (added by toscho, 7 years ago)

Renamed filter to 'wp_version_check_query_variables'

  • wp-includes/update.php

     
    5757        }
    5858
    5959        $local_package = isset( $wp_local_package )? $wp_local_package : '';
    60         $url = "http://api.wordpress.org/core/version-check/1.5/?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package&blogs=$num_blogs&users={$user_count['total_users']}&multisite_enabled=$multisite_enabled";
    6160
     61        $update_data = array (
     62                'version'           => $wp_version,
     63                'php'               => $php_version,
     64                'locale'            => $locale,
     65                'mysql'             => $mysql_version,
     66                'local_package'     => $local_package,
     67                'blogs'             => $num_blogs,
     68                'users'             => $user_count['total_users'],
     69                'multisite_enabled' => $multisite_enabled
     70        );
     71        $update_data = apply_filters( 'wp_version_check_query_variables', $update_data );
     72
     73        $query_string = '';
     74        foreach ( $update_data as $key => $value ) {
     75                $query_string .= "$key=$value&";
     76        }
     77        $url = 'http://api.wordpress.org/core/version-check/1.5/?' . rtrim( $query_string, '&' );
     78
    6279        $options = array(
    6380                'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3 ),
    6481                'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),