Skip to content

Instantly share code, notes, and snippets.

@chodorowicz
Created June 21, 2016 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chodorowicz/ebde5a1ba63a746510e38bcf668e8c10 to your computer and use it in GitHub Desktop.
Save chodorowicz/ebde5a1ba63a746510e38bcf668e8c10 to your computer and use it in GitHub Desktop.
ACF register options page WordPress #Wordpress
<?php
/** simple */
acf_add_options_page("Site Options");
/** complex */
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Theme General Settings',
'menu_title' => 'Theme Settings',
'menu_slug' => 'theme-general-settings',
'capability' => 'edit_posts',
'redirect' => false
));
acf_add_options_sub_page(array(
'page_title' => 'Theme Header Settings',
'menu_title' => 'Header',
'parent_slug' => 'theme-general-settings',
));
acf_add_options_sub_page(array(
'page_title' => 'Theme Footer Settings',
'menu_title' => 'Footer',
'parent_slug' => 'theme-general-settings',
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment