WordPress.org

Make WordPress Core

Ticket #21761: no-load-widgets.diff

File no-load-widgets.diff, 611 bytes (added by greenshady, 6 years ago)

Don't load widgets at all

  • wp-includes/functions.php

     
    25252525 * @uses add_action() Calls '_admin_menu' hook with 'wp_widgets_add_menu' value.
    25262526 */
    25272527function wp_maybe_load_widgets() {
    2528         if ( ! apply_filters('load_default_widgets', true) )
     2528        if ( ! apply_filters( 'load_default_widgets', current_theme_supports( 'widgets' ) ) )
    25292529                return;
    25302530        require_once( ABSPATH . WPINC . '/default-widgets.php' );
    25312531        add_action( '_admin_menu', 'wp_widgets_add_menu' );