Remove
function wp_maybe_load_widgets() {
if ( !function_exists( 'dynamic_sidebar' ) ) {
require_once ABSPATH . WPINC . '/widgets.php';
add_action( '_admin_menu', 'wp_widgets_add_menu' );
}
}
function wp_widgets_add_menu() {
global $submenu;
$submenu['themes.php'][7] = array( __( 'Widgets' ), 'switch_themes', 'widgets.php' );
ksort($submenu['themes.php'], SORT_NUMERIC);
}
in functions.php
Or what?
Why not just remove the function call out of a theme's function.php file? That's the quickest method of doing it.
or in upgrade-functions.php ?????
function maybe_disable_automattic_widgets() {
$plugins = __get_option( 'active_plugins' );
foreach ( (array) $plugins as $plugin ) {
if ( basename( $plugin ) == 'widgets.php' ) {
array_splice( $plugins, array_search( $plugin, $plugins ), 1 );
update_option( 'active_plugins', $plugins );
break;
}
}
}
That only gets run during an upgrade and would shut off widgets for all themes.
The add_menu calls just removes the menu page from the admin. Probably would work if no widgets have been assigned at all yet.