I have now updated the code and added this
function so the page can be accessed even when hidden.
function ccms_developer_theme_menu() {
$options = get_option('ccms_developer_options');
if( $options['show_admin_dev'] ==1 )
$show_dev = 1;
else
$show_dev = 0;
add_submenu_page(
'ccms', // The ID of the top-level menu page to which this submenu item belongs
__( 'Developer Options', 'ccms' ), // The value used to populate the browser's title bar when the menu page is active
__( 'Developer Options', 'ccms' ), // The label of this submenu item displayed in the menu
'administrator', // What roles are able to access this submenu item
'ccms-dev', // The ID used to represent this submenu item
'ccms_developer_display' // The callback function used to render the options for this submenu item
);
if( $show_dev ==0 )
remove_submenu_page( 'ccms', 'ccms-dev' );
} // end ccms_developer_theme_menu
But when accessing the page while its hidden i now get this warning and no page outputs.
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'ccms_developer_options' not found or invalid function name in E:\composite-cms\test\wp-includes\plugin.php on line 406
the full code can be found on github
ccms_developer_optionsdoes not exist, and that's correct. Your naming convention seems a bit confusing, what aboutccms_options,ccms_settingsandccms_callback? – brasofilo Dec 27 '12 at 16:43