Welcome, visitor! Log in
 

Source View: core_version_check_locale

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN  (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
20   */
21  function wp_version_check() {
22       if ( defined('WP_INSTALLING') )
23            return;
24  
25       global $wp_version, $wpdb, $wp_local_package;
26       $php_version = phpversion();
27  
28       $current = get_transient( 'update_core' );
29       if ( ! is_object($current) ) {
30            $current = new stdClass;
31            $current->updates = array();
32            $current->version_checked = $wp_version;
33       }
34  
35       $locale = apply_filters( 'core_version_check_locale', get_locale() );
36  
37       // Update last_checked for current to prevent multiple blocking requests if request hangs
38       $current->last_checked = time();
39       set_transient( 'update_core', $current );
40  
41       if ( method_exists( $wpdb, 'db_version' ) )
42            $mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version($wpdb->users));
43       else
44            $mysql_version = 'N/A';
45       $local_package = isset( $wp_local_package )? $wp_local_package : '';
46       $url = "http://api.wordpress.org/core/version-check/1.3/?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package";
47  
48       $options = array(
49            'timeout' => 3,
50            'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )