Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Options Framework Top Level Options
function add_custom_options_page() {
$menu = $this->menu_settings();
switch( $menu['mode'] ) {
case 'menu':
// http://codex.wordpress.org/Function_Reference/add_menu_page
$this->options_screen = add_menu_page(
$menu['page_title'],
$menu['menu_title'],
$menu['capability'],
$menu['menu_slug'],
array( $this, 'options_page' ),
$menu['icon_url'],
$menu['position']
);
break;
default:
// http://codex.wordpress.org/Function_Reference/add_submenu_page
$this->options_screen = add_submenu_page(
$menu['parent_slug'],
$menu['page_title'],
$menu['menu_title'],
$menu['capability'],
$menu['menu_slug'],
array( $this, 'options_page' ) );
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment