WordPress.org

Make WordPress Core

Ticket #4169: new-loading-widgets.diff

File new-loading-widgets.diff, 1.5 KB (added by rob1n, 8 years ago)
  • wp-includes/default-filters.php

     
    174174add_action('mce_options', '_mce_set_direction'); 
    175175add_action('init', 'smilies_init', 5); 
    176176 
    177 add_action( 'plugins_loaded', 'wp_load_widgets', 0 ); 
     177add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); 
    178178 
    179179?> 
     180 No newline at end of file 
  • wp-includes/widgets.php

     
    11<?php 
    22 
    3 /* 
    4         Check if another widget plugin is active. If this is so,  
    5         then bail out. 
    6 */ 
    7  
    8 if ( function_exists( 'dynamic_sidebar' ) ) { 
    9         return; 
    10 } 
    11  
    123/* Global Variables */ 
    134 
    145global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_styles, $wp_registered_widget_defaults; 
  • wp-includes/functions.php

     
    15021502        endif; 
    15031503} 
    15041504 
    1505 function wp_load_widgets() { 
    1506         require_once ABSPATH . WPINC . '/widgets.php'; 
     1505function wp_maybe_load_widgets() { 
     1506        if ( !function_exists( 'dynamic_sidebar' ) ) { 
     1507                require_once ABSPATH . WPINC . '/widgets.php'; 
     1508        } 
    15071509} 
    15081510 
    15091511?> 
     1512 No newline at end of file