stats_ignore_db_version

Prevent sparkline img requests being redirected to upgrade.php.

Description

stats_ignore_db_version( $version ); 

See wp-admin/admin.php where it checks $wp_db_version.

Parameters (1)

0. $version
The version.

Usage

  1. if ( !function_exists( 'stats_ignore_db_version' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/stats.php'; 
  3.  
  4. // The version. 
  5. $version = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = stats_ignore_db_version($version); 
  9.  

Defined (1)

The function is defined in the following location(s).

/modules/stats.php  
  1. function stats_ignore_db_version( $version ) { 
  2. if ( 
  3. is_admin() && 
  4. isset( $_GET['page'] ) && $_GET['page'] == 'stats' && 
  5. isset( $_GET['chart'] ) && strpos($_GET['chart'], 'admin-bar-hours') === 0 
  6. ) { 
  7. global $wp_db_version; 
  8. return $wp_db_version; 
  9. return $version;