On this page
get_preferred_from_update_core(): object|array|false
Selects the first update version from the update_core option.
Return
object|array|false The response from the API on success, false on failure.
Source
File: wp-admin/includes/update.php. View all references
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];
}
Related
Uses
| Uses | Description |
|---|---|
| get_core_updates() wp-admin/includes/update.php | Gets available core updates. |
Used By
| Used By | Description |
|---|---|
| WP_Automatic_Updater::send_email() wp-admin/includes/class-wp-automatic-updater.php | Sends an email upon the completion or failure of a background core update. |
| core_update_footer() wp-admin/includes/update.php | Returns core update footer message. |
| update_nag() wp-admin/includes/update.php | Returns core update notification message. |
| update_right_now_message() wp-admin/includes/update.php | Displays WordPress version and active theme in the ‘At a Glance’ dashboard widget. |
Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_preferred_from_update_core