@@ -242,10 +242,6 @@ public function __construct( $sections = array(), $args = array(), $extra_tabs =
242242 */
243243 $ this ->args = apply_filters ( "redux/options/ {$ this ->args ['opt_name ' ]}/args " , $ this ->args );
244244
245- if ( Redux_Helpers::isLocalHost () || ( defined ( 'WP_DEBUG ' ) && WP_DEBUG == true ) ) {
246- $ this ->args ['dev_mode ' ] = true ;
247- }
248-
249245 // Do not save the defaults if we're on a live preview!
250246 if ( $ GLOBALS ['pagenow ' ] == "customize " && isset ( $ _GET ['theme ' ] ) && ! empty ( $ _GET ['theme ' ] ) ) {
251247 $ this ->args ['save_defaults ' ] = false ;
@@ -460,7 +456,7 @@ private function set_default_args() {
460456 // menu title/text
461457 'page_title ' => '' ,
462458 // option page title
463- 'page_slug ' => '_options ' ,
459+ 'page_slug ' => '' ,
464460 'page_permissions ' => 'manage_options ' ,
465461 'menu_type ' => 'menu ' ,
466462 // ('menu'|'submenu')
@@ -1224,6 +1220,25 @@ private function _default_cleanup() {
12241220 if ( $ this ->args ['global_variable ' ] == "" && $ this ->args ['global_variable ' ] !== false ) {
12251221 $ this ->args ['global_variable ' ] = str_replace ( '- ' , '_ ' , $ this ->args ['opt_name ' ] );
12261222 }
1223+
1224+ // Force dev_mode on WP_DEBUG = true and if it's a local server
1225+ if ( Redux_Helpers::isLocalHost () || ( defined ( 'WP_DEBUG ' ) && WP_DEBUG == true ) ) {
1226+ $ this ->args ['dev_mode ' ] = true ;
1227+ }
1228+
1229+ // Auto create the page_slug appropriately
1230+ if ( empty ( $ this ->args ['page_slug ' ] ) ) {
1231+ if ( ! empty ( $ this ->args ['display_name ' ] ) ) {
1232+ $ this ->args ['page_slug ' ] = sanitize_html_class ( $ this ->args ['display_name ' ] );
1233+ } else if ( ! empty ( $ this ->args ['page_title ' ] ) ) {
1234+ $ this ->args ['page_slug ' ] = sanitize_html_class ( $ this ->args ['page_title ' ] );
1235+ } else if ( ! empty ( $ this ->args ['menu_title ' ] ) ) {
1236+ $ this ->args ['page_slug ' ] = sanitize_html_class ( $ this ->args ['menu_title ' ] );
1237+ } else {
1238+ $ this ->args ['page_slug ' ] = str_replace ( '- ' , '_ ' , $ this ->args ['opt_name ' ] );
1239+ }
1240+ }
1241+
12271242 }
12281243
12291244 /**
0 commit comments