How to remove all widgets temporarily?

Home Forums Calendar Products Events Calendar PRO How to remove all widgets temporarily?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #81006
    tiltdigital
    Participant

    Hi,
    I’m trying to remove all widgets from the admin area as we don’t want our client to have this functionality until later in the project. As with the native WP widgets I’ve tried to unregister the Tribe widgets in my functions.php (so not to mess with your core files) but so far I can only manage to get the Countdown widget to disappear. This is the code that I’m using:

    function my_unregister_widgets() {
    unregister_widget( ‘TribeCountdownWidget’ );
    unregister_widget( ‘TribeVenueWidget’ );
    unregister_widget( ‘TribeEventsMiniCalendarWidget’ );
    unregister_widget( ‘TribeEventsAdvancedListWidget’ );
    }
    add_action( ‘widgets_init’, ‘my_unregister_widgets’ );

    But only the first one is doing what I’d expect. I’ve tried searching your forums and Google, but can’t seem to find the answer.
    Thanks in advance.

    #81105
    Brook
    Participant

    Howdy,

    The following code snippet should work:

    function my_unregister_widgets() {
    unregister_widget( ‘TribeCountdownWidget’ );
    unregister_widget( ‘TribeVenueWidget’ );
    }
    add_action( ‘widgets_init’, ‘my_unregister_widgets’, 10 );
    remove_action( ‘widgets_init’, ‘events_list_load_widgets’, 90 );
    remove_action( ‘widgets_init’, array( TribeEventsPro::instance(), ‘pro_widgets_init’ ), 100 );

    The widgets have a high priority which makes them hard to remove, but removing the action will work.

    I hope that helps you. Let me know if I can assist further.

    – Brook

    #81204
    tiltdigital
    Participant

    Hi,
    Thanks for your quick reply!
    That’s pretty much done exactly what I was hoping for, except the “Events Featured Venue” widget is the only still showing in the Widgets list.
    Thanks

    #81244
    Brook
    Participant

    Howdy again,

    That is strange. Try adding the following line which removes the action for the widget as well:
    remove_action( ‘widgets_init’, ‘tribe_venue_register_widget’ );

    You are very welcome! Please let me know if that works.

    – Brook

    #81382
    tiltdigital
    Participant

    Almost, but you gave me enough of a hint to figure it out!
    remove_action( ‘widgets_init’, ‘tribe_venue_register_widget’, 100 );
    Did the trick. 🙂
    Thanks

    #81386
    Brook
    Participant

    I am glad you got it working on your server as well. Thanks for sharing your solution.

    #982599
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘How to remove all widgets temporarily?’ is closed to new replies.