Support

Account

Home Forums Backend Issues (wp-admin) acf_add_options_page within a plugin

Solved

acf_add_options_page within a plugin

  • Greetings,

    I am having trouble calling acf_add_options_page from within a plugin. The call works fine from within a theme but it is never finding the function within the plugin,

    Here is my code:

    
    add_action( 'wp_loaded',  'my_options_page' );
    
    function my_options_page() {
    
        if( function_exists('acf_add_options_page') ) {
            echo 'Found the Function!';
            acf_add_options_page(array(
                'parent_slug' => 'edit.php?post_type=adverts',
                'menu_slug' => 'advert-settings',
                'menu_title' => 'Settings',
                'page_title' => 'Advert Settings',
                'icon_url' => 'dashicons-admin-settings'
            ));
        }
    }

    Anyone else have this issue?

  • Solved it, it was a new build and ACF wasn’t enabled *eyeroll*

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

The topic ‘acf_add_options_page within a plugin’ is closed to new replies.