diff --git a/admin.php b/admin.php index 0225cbd..b10cd86 100644 --- a/admin.php +++ b/admin.php @@ -5,7 +5,7 @@ add_action('admin_init', 'register_ss_settings'); function register_ss_settings() { register_setting(SS_SETTINGS_FIELD, SS_SETTINGS_FIELD); - add_option(SS_SETTINGS_FIELD, '__return_empty_array', '', 'yes'); + add_option(SS_SETTINGS_FIELD, array(), '', 'yes'); } /** @@ -96,7 +96,7 @@ function ss_settings_admin() { ?> -
+ diff --git a/functions.php b/functions.php index c12f5bc..ede9528 100644 --- a/functions.php +++ b/functions.php @@ -50,6 +50,10 @@ function ss_create_sidebar( $args = array() ) { // nonce verification check_admin_referer('simple-sidebars-action_create-sidebar'); + // WP changes a numeric sidebar id to sidebar-id which makes it inaccessible to the user + if ( is_numeric( $args['id'] ) ) + $args['id'] = sanitize_title_with_dashes( $args['name'] ); + $db = (array)get_option(SS_SETTINGS_FIELD); $new = array( sanitize_title_with_dashes( $args['id'] ) => array( @@ -81,6 +85,10 @@ function ss_edit_sidebar( $args = array() ) { // nonce verification check_admin_referer('simple-sidebars-action_edit-sidebar'); + // WP changes a numeric sidebar id to sidebar-id which makes it inaccessible to the user + if ( is_numeric( $args['id'] ) ) + $args['id'] = sanitize_title_with_dashes( $args['name'] ); + $db = (array)get_option(SS_SETTINGS_FIELD); $new = array( sanitize_title_with_dashes( $args['id'] ) => array( @@ -137,7 +145,7 @@ function ss_error_message( $error = false ) { return __('Oops! Please choose a valid Name and ID for this sidebar', 'ss'); break; case 2: - return __('Oops! That sidebar ID already exists'); + return __('Oops! That sidebar ID already exists', 'ss'); break; case 3: return __('Oops! You are trying to edit a sidebar that does not exist, or is not editable', 'ss'); diff --git a/inpost.php b/inpost.php index b8317a2..78a65ad 100644 --- a/inpost.php +++ b/inpost.php @@ -7,7 +7,7 @@ add_action('admin_menu', 'ss_add_inpost_metabox'); function ss_add_inpost_metabox() { foreach ( (array)get_post_types( array( 'public' => true ) ) as $type ) { if ( post_type_supports( $type, 'genesis-simple-sidebars' ) || $type == 'post' || $type == 'page' ) { - add_meta_box('ss_inpost_metabox', __('Sidebar Selection', 'genesis'), 'ss_inpost_metabox', $type, 'side', 'low'); + add_meta_box('ss_inpost_metabox', __('Sidebar Selection', 'ss'), 'ss_inpost_metabox', $type, 'side', 'low'); } } } @@ -29,7 +29,14 @@ function ss_inpost_metabox() { ?> - +