Make WordPress Core

Ticket #26876: 26876.diff

File 26876.diff, 691 bytes (added by kovshenin, 12 years ago)
  • src/wp-includes/widgets.php

     
    125125        // Private Functions. Don't worry about these.
    126126
    127127        function _register() {
    128                 $settings = $this->get_settings();
     128                $settings = false;
    129129                $empty = true;
    130130
     131                // Prefetch settings only for widgets that are used (whether active or inactive)
     132                if ( is_active_widget( false, false, $this->id_base, false ) ) {
     133                        $settings = $this->get_settings();
     134                }
     135
    131136                if ( is_array($settings) ) {
    132137                        foreach ( array_keys($settings) as $number ) {
    133138                                if ( is_numeric($number) ) {