Created
February 10, 2015 00:49
-
-
Save designbuildtest/e87304341dca223a6dfd to your computer and use it in GitHub Desktop.
De-register widgets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mytheme_remove_default_widgets() { | |
| $widgets = array( | |
| 'WP_Nav_Menu_Widget', | |
| 'WP_Widget_Archives', | |
| 'WP_Widget_Calendar', | |
| 'WP_Widget_Categories', | |
| 'WP_Widget_Meta', | |
| 'WP_Widget_Pages', | |
| 'WP_Widget_Recent_Comments', | |
| 'WP_Widget_Recent_Posts', | |
| 'WP_Widget_RSS', | |
| 'WP_Widget_Search', | |
| 'WP_Widget_Tag_Cloud' | |
| ); | |
| foreach ( $widgets as $widget ) { | |
| unregister_widget( $widget ); | |
| } | |
| } | |
| add_action( 'widgets_init', 'mytheme_remove_default_widgets', 11 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment