diff --git a/includes/inpost.php b/includes/inpost.php index f5d96eb..7b99b68 100644 --- a/includes/inpost.php +++ b/includes/inpost.php @@ -6,12 +6,6 @@ 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' ) { @@ -86,8 +80,8 @@ function ss_inpost_metabox_save( $post_id, $post ) { return $post->ID; $_sidebars = array( - '_ss_sidebar' => $_POST['_ss_sidebar'], - '_ss_sidebar_alt' => $_POST['_ss_sidebar_alt'], + '_ss_sidebar' => isset( $_POST['_ss_sidebar'] ) ? $_POST['_ss_sidebar'] : '', + '_ss_sidebar_alt' => isset( $_POST['_ss_sidebar_alt'] ) ? $_POST['_ss_sidebar_alt'] : '', ); //* store the custom fields diff --git a/plugin.php b/plugin.php index 13f5e46..f1de1d8 100644 --- a/plugin.php +++ b/plugin.php @@ -9,7 +9,7 @@ Author URI: http://www.nathanrice.net/ Text Domain: genesis-simple-sidebars Domain Path: /languages/ -Version: 2.0.2 +Version: 2.0.3 License: GNU General Public License v2.0 (or later) License URI: http://www.opensource.org/licenses/gpl-license.php @@ -101,6 +101,10 @@ function ss_register_sidebars() { //* Cycle through created sidebars, register them as widget areas foreach ( (array) $_sidebars as $id => $info ) { + if ( ! isset( $info['name'] ) || ! isset( $info['description'] ) ) { + continue; + } + genesis_register_sidebar( array( 'name' => esc_html( $info['name'] ), 'id' => $id, diff --git a/readme.txt b/readme.txt index 0b65502..41c54b6 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: nathanrice, wpmuguru Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118 Tags: hooks, genesis, genesiswp, studiopress Requires at least: 3.6 -Tested up to: 4.3.1 -Stable tag: 2.0.2 +Tested up to: 4.5 +Stable tag: 2.0.3 This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Framework on a per post, per page, or per tag/category archive basis. @@ -37,6 +37,9 @@ Not in the way you're probably thinking. The markup surrounding the widget area == Changelog == += 2.0.3 = +* Fix warnings and notices + = 2.0.2 = * Change text domain, update POT file.