Support

Account

Home Forums ACF PRO acf_add_options_page() undefined

Solving

acf_add_options_page() undefined

    • Patrik

    • October 15, 2019 at 5:56 pm

    I’ve created countless sites with options pages and never had any issues. But this site, running the latest ACF PRO, says acf_add_options_page() is an undefined function.

    What possible reason could there be for this?

    The code I’m executing in the very top of my theme’s functions.php:

    function _hs_reg_acf_options_page() {
    	if ( ! function_exists( 'acf_add_options_page' ) ) { return; }
    	$option_page = acf_add_options_page( array(
    		'page_title'    => 'Settings',
    		'menu_title'    => 'Settings',
    		'menu_slug'     => 'general-settings',
    		'capability'    => 'edit_posts',
    		'redirect'      => false
    	) );
    }
    add_action('acf/init', '_hs_reg_acf_options_page');

    Removing the function_exists() wrapper is what throws the error, of course.

    • Patrik

    • October 15, 2019 at 6:08 pm

    Small update: When searching for “acf_add_options_page” within the ACF plugin folder, zero results come up.

    Has this function been removed!?

    • Patrik

    • October 15, 2019 at 8:00 pm

    *huge sigh*

    Nevermind. I didn’t realize that the site I’m working on (a project I recently took over) doesn’t even have PRO, but the free version. So I’ll be adding PRO shortly.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘acf_add_options_page() undefined’ is closed to new replies.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.