mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Fix core update checking. Don't check on every page load.
git-svn-id: https://develop.svn.wordpress.org/trunk@9512 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -34,9 +34,13 @@ function get_core_updates( $options = array() ) {
|
||||
$dismissed = get_option( 'dismissed_update_core' );
|
||||
if ( !is_array( $dismissed ) ) $dismissed = array();
|
||||
$from_api = get_option( 'update_core' );
|
||||
if ( !is_array( $from_api ) ) return false;
|
||||
if ( empty($from_api) )
|
||||
return false;
|
||||
if ( !is_array( $from_api->updates ) ) return false;
|
||||
$updates = $from_api->updates;
|
||||
if ( !is_array( $updates ) ) return false;
|
||||
$result = array();
|
||||
foreach($from_api as $update) {
|
||||
foreach($updates as $update) {
|
||||
if ( array_key_exists( $update->current.'|'.$update->locale, $dismissed ) ) {
|
||||
if ( $options['dismissed'] ) {
|
||||
$update->dismissed = true;
|
||||
@@ -68,8 +72,9 @@ function undismiss_core_update( $version, $locale ) {
|
||||
|
||||
function find_core_update( $version, $locale ) {
|
||||
$from_api = get_option( 'update_core' );
|
||||
if ( !is_array( $from_api ) ) return false;
|
||||
foreach($from_api as $update) {
|
||||
if ( !is_array( $from_api->updates ) ) return false;
|
||||
$updates = $from_api->updates;
|
||||
foreach($updates as $update) {
|
||||
if ( $update->current == $version && $update->locale == $locale )
|
||||
return $update;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user