Home › Forums › Calendar Products › Events Calendar PRO › How to remove all widgets temporarily?
- This topic has 6 replies, 3 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
December 10, 2013 at 8:15 am #81006
tiltdigital
ParticipantHi,
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.December 10, 2013 at 1:23 pm #81105Brook
ParticipantHowdy,
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
December 11, 2013 at 1:40 am #81204tiltdigital
ParticipantHi,
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.
ThanksDecember 11, 2013 at 8:50 am #81244Brook
ParticipantHowdy 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
December 12, 2013 at 5:06 am #81382tiltdigital
ParticipantAlmost, but you gave me enough of a hint to figure it out!
remove_action( ‘widgets_init’, ‘tribe_venue_register_widget’, 100 );
Did the trick. 🙂
ThanksDecember 12, 2013 at 5:29 am #81386Brook
ParticipantI am glad you got it working on your server as well. Thanks for sharing your solution.
July 7, 2015 at 6:30 am #982599Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘How to remove all widgets temporarily?’ is closed to new replies.
