The MU forums have moved to WordPress.org

Widgets turn off? (4 posts)

  1. Parado
    Member
    Posted 16 years ago #

    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?

  2. drmiketemp
    Member
    Posted 16 years ago #

    Why not just remove the function call out of a theme's function.php file? That's the quickest method of doing it.

  3. Parado
    Member
    Posted 16 years ago #

    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;
    }
    }
    }

  4. drmiketemp
    Member
    Posted 16 years ago #

    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.

About this Topic

  • Started 16 years ago by Parado
  • Latest reply from drmiketemp