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
if ( !function_exists( 'get_preferred_from_update_core' ) ) { require_once ABSPATH . '/wp-admin/includes/update.php'; } // NOTICE! Understand what this does before running. $result = get_preferred_from_update_core();
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/update.php
- function get_preferred_from_update_core() {
- $updates = get_core_updates();
- if ( ! is_array( $updates ) )
- return false;
- if ( empty( $updates ) )
- return (object) array( 'response' => 'latest' );
- return $updates[0];
- }