From 7395bd6db34a7f923748976b1e9cae0d547ba0d7 Mon Sep 17 00:00:00 2001 From: Nick Croft Date: Wed, 25 Jun 2014 13:10:30 -0400 Subject: [PATCH] don't show metabox if both sidebars disabled addresses #9 --- includes/inpost.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/inpost.php b/includes/inpost.php index c1fb2ce..53d1fab 100644 --- a/includes/inpost.php +++ b/includes/inpost.php @@ -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' ) {