Skip to content

Instantly share code, notes, and snippets.

@verticalgrain
Last active August 29, 2015 14:13
Show Gist options
  • Save verticalgrain/ae8ac5dbe84fd588d50c to your computer and use it in GitHub Desktop.
Save verticalgrain/ae8ac5dbe84fd588d50c to your computer and use it in GitHub Desktop.
Advanced Custom Fields multipe options pages - with sub pages
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Options',
'menu_title' => 'Options',
'menu_slug' => 'options',
'capability' => 'edit_posts',
'icon_url' => 'dashicons-forms',
'redirect' => false
));
acf_add_options_sub_page(array(
'page_title' => 'Page 1',
'menu_title' => 'Page 1',
'parent_slug' => 'options',
));
acf_add_options_sub_page(array(
'page_title' => 'Page 2',
'menu_title' => 'Page 2',
'parent_slug' => 'options',
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment