Created
January 16, 2012 21:47
-
-
Save billerickson/1623202 to your computer and use it in GitHub Desktop.
This file contains 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
Index: lib/functions/general.php | |
=================================================================== | |
--- lib/functions/general.php (revision 557) | |
+++ lib/functions/general.php (working copy) | |
@@ -125,4 +125,18 @@ | |
return false; | |
+} | |
+ | |
+add_action( 'genesis_theme_settings_metaboxes', 'genesis_remove_default_widgets_from_header_right' ); | |
+/** | |
+ * Remove Default Widgets from Header Right | |
+ * | |
+ */ | |
+function genesis_remove_default_widgets_from_header_right() { | |
+ $widgets = get_option( 'sidebars_widgets' ); | |
+ $defaults = array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', ); | |
+ if( $defaults == $widgets['header-right'] ) { | |
+ $widgets['header-right'] = array(); | |
+ update_option( 'sidebars_widgets', $widgets ); | |
+ } | |
} | |
\ No newline at end of file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment