Make WordPress Core

Ticket #44118: 44118-after-coding-standards-change.diff

File 44118-after-coding-standards-change.diff, 1.4 KB (added by siliconforks, 15 months ago)

Refreshed patch to work after r54891 (which modified coding standards to require parentheses for calls to constructors)

  • src/wp-includes/update.php

    diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php
    index 5136912037..faaa82db91 100644
    a b function wp_update_plugins( $extra_stats = array() ) { 
    330330                $current = new stdClass();
    331331        }
    332332
    333         $updates               = new stdClass();
    334         $updates->last_checked = time();
    335         $updates->response     = array();
    336         $updates->translations = array();
    337         $updates->no_update    = array();
    338 
    339333        $doing_cron = wp_doing_cron();
    340334
    341335        // Check for update on a different schedule, depending on the page.
    function wp_update_plugins( $extra_stats = array() ) { 
    364358                $plugin_changed = false;
    365359
    366360                foreach ( $plugins as $file => $p ) {
    367                         $updates->checked[ $file ] = $p['Version'];
    368 
    369361                        if ( ! isset( $current->checked[ $file ] ) || (string) $current->checked[ $file ] !== (string) $p['Version'] ) {
    370362                                $plugin_changed = true;
    371363                        }
    function wp_update_plugins( $extra_stats = array() ) { 
    453445                return;
    454446        }
    455447
     448        $updates               = new stdClass();
     449        $updates->last_checked = time();
     450        $updates->response     = array();
     451        $updates->translations = array();
     452        $updates->no_update    = array();
     453        foreach ( $plugins as $file => $p ) {
     454                $updates->checked[ $file ] = $p['Version'];
     455        }
     456
    456457        $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
    457458
    458459        if ( $response && is_array( $response ) ) {