get_preferred_from_update_core

Selects the first update version from the update_core option.

Description

(object|array|false) get_preferred_from_update_core(); 

Returns (object|array|false)

The response from the API on success, false on failure.


Usage

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

Defined (1)

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

/wp-admin/includes/update.php  
  1. function get_preferred_from_update_core() { 
  2. $updates = get_core_updates(); 
  3. if ( ! is_array( $updates ) ) 
  4. return false; 
  5. if ( empty( $updates ) ) 
  6. return (object) array( 'response' => 'latest' ); 
  7. return $updates[0];