don't show metabox if both sidebars disabled

addresses #9
This commit is contained in:
Nick Croft
2014-06-25 13:10:30 -04:00
parent ee29d99335
commit 7395bd6db3
+6
View File
@@ -6,6 +6,12 @@ add_action('admin_menu', 'ss_add_inpost_metabox');
*/
function ss_add_inpost_metabox() {
global $wp_registered_sidebars;
if( ! array_key_exists( 'sidebar', $wp_registered_sidebars ) && ! array_key_exists( 'sidebar-alt', $wp_registered_sidebars ) ){
return;
}
foreach ( (array) get_post_types( array( 'public' => true ) ) as $type ) {
if ( post_type_supports( $type, 'genesis-simple-sidebars' ) || $type == 'post' || $type == 'page' ) {