_maybe_update_themes

Check themes versions only after a duration of time.

Description

_maybe_update_themes(); 

This is for performance reasons to make sure that on the theme version checker is not run on every page load.


Usage

  1. if ( !function_exists( '_maybe_update_themes' ) ) { 
  2. require_once ABSPATH . WPINC . '/update.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = _maybe_update_themes(); 
  7.  

Defined (1)

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

/wp-includes/update.php  
  1. function _maybe_update_themes() { 
  2. $current = get_site_transient( 'update_themes' ); 
  3. if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) ) 
  4. return;