By
05/13/2016   Comments Off on Create an Options Page (ACF 5+)

View all snippets

To create an options page in WordPress using Advanced Custom Fields use this code and alter the highlighted as needed:

add_action( 'admin_menu', 'add_new_page', 98 );

function add_new_page() { 
   if( function_exists('acf_add_options_page') ) {
       acf_add_options_page(array(
         'page_title' => 'Page Title',
         'menu_title' => 'Menu Title',
         'menu_slug' =>  'page-slug',
         'capability' => 'edit_posts',
         'redirect' => false
         )); 
    }
}