Welcome! To use this support forum, please Login or Join Today!

   

ACF Options Page / Debug Mode

{name}
Rank

Total Posts: 23

Joined 2015-08-06

PM

 

Hi Casey,

Firstly, this doesn’t seem critical, but thought it might be of interest to you and others.

I’ve enabled the ACF field group menu item in the Admin panel and I’ve created a number of custom fields in a Mobius child theme.

/*-----------------------------------------------------------------------------------*/
// Show Advanced Custom Fields in Admin Menu
/*-----------------------------------------------------------------------------------*/

 
function show_acf() {
     
return true;
 

Some fields are reused on multiple pages so I created an options page to consolidate the input process (e.g, an options page for header and footer info). The options page displays, as long as the function runs within the ‘init’ or ‘acf/init’ actions .

/*-----------------------------------------------------------------------------------*/
// Add an ACF Options Page
/*-----------------------------------------------------------------------------------*/

function custom_acf_init() {

    
if ( function_exists('acf_add_options_page') ) {
        
        acf_add_options_page
(array(
            
'page_title'    => 'Header and Footer Settings',
            
'menu_title'    => 'Header and Footer Settings',
            
'menu_slug'     => 'general-settings',
            
'capability'    => 'edit_posts',
            
'redirect'      => true
        
));
        
        
acf_add_options_sub_page(array(
            
'page_title'    => 'Header Settings',
            
'menu_title'    => 'Header',
            
'parent_slug'   => 'general-settings',
        ));
        
        
acf_add_options_sub_page(array(
            
'page_title'    => 'Footer Settings',
            
'menu_title'    => 'Footer',
            
'parent_slug'   => 'general-settings',
        ));
        
    
}

}

add_action
('acf/init''custom_acf_init'); 

Seems to work fine, but in debug mode I get the following warning in Users > My Profile > Profile, on all pages when editing, Widgets, and on the ACF options page/subpages:

Notice: Undefined variable: editor_id in /Users/Me/Documents/Websites/www.dev-copy.dev/wp-content/themes/mobius/functions.php on line 1969

It appears to be ACF Pro related, but I didn’t know if this was debug mode just showing too much information or something more. Is this safe to ignore or does it require a fix?