Home › Forums › Backend Issues (wp-admin) › Trying to add an Options Subpage to an Options Page defined by another plugin
I’m struggling to get the Options Menu settings to work for me.
I’m adding an Options Menu via acf_add_options_page() in a plugin that I’m treating as a “parent” plugin that has some global settings and functionality for a multisite network of sites…
if (function_exists('acf_add_options_page')) {
acf_add_options_page(
array(
'page_title' => 'Geauga Connected Dashboard',
'menu_title' => 'Geauga Connected',
'menu_slug' => 'geauga-connected-dashboard',
'capability' => 'edit_posts',
'redirect' => false,
'position' => 2,
)
);
}
What I want to do is use acf_add_options_sub_page() within other plugins to add submenus to the “parent” plugin’s Options Page…
if (function_exists('acf_add_options_sub_page')) {
acf_add_options_sub_page(
array(
'page_title' => 'Alert Bar Settings',
'menu_title' => 'Alert Bar',
'parent_slug' => 'geauga-connected-dashboard',
'capability' => 'manage_options',
'menu_slug' => 'alert-bar-settings',
'position' => 10,
)
);
}
No matter what I’ve tried, I cannot get the submenu to display at all. I’ve messed with the hook priority settings, ie. loading the “parent” plugin’s acf/init hook before the other plugin’s acf/init hook, but the submenu is not being added.

Are you saying that the plugin is already using ACF and that the first code that you supplied is how that plugin is adding the options page?
@hube2 Yes, the first code block is how the main plugin is adding the Options Page – sorry for the confusion.

The only thing that I can think of is that the sub page code is being called before the parent page is added. I would wrap the code in acf/init actions so that I could control the order they are run by setting priority.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.