From f96e67d4df9f078c352b6dc4335c442b45f55f3d Mon Sep 17 00:00:00 2001 From: Nathan Rice Date: Wed, 1 Mar 2017 19:27:10 -0500 Subject: [PATCH] Allow for empty ID. fixes #11. --- includes/class-genesis-simple-sidebars-admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-genesis-simple-sidebars-admin.php b/includes/class-genesis-simple-sidebars-admin.php index a25dac6..81c9c02 100644 --- a/includes/class-genesis-simple-sidebars-admin.php +++ b/includes/class-genesis-simple-sidebars-admin.php @@ -223,8 +223,8 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic { // 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'] ) ) { + // Change empty or numeric IDs to the name, lowercased and separated by dashes. + if ( empty( $args['id'] ) || is_numeric( $args['id'] ) ) { $args['id'] = sanitize_title_with_dashes( $args['name'] ); }