Home › Forums › Add-ons › Options Page › Options Page Disappeared
I’ve just upgraded ACF and Options Page to the latest versions, both of which are being included via functions.php, bundled with a custom theme. After updating, my options page disappeared. Viewing the ACF “Add Ons” page, I can see that options page is installed and I can attach fieldgroups to it however there is no menu item for it in wp-admin.
Hi Allen,
Is it possible that you have registered sub options pages, if so, what code are you using?
Have you inspected the DOM to make sure the menu item is not being hidden by CSS.
Have you used a filter on the wp menu to remove any items?
Are you able to change theme, and install ACF / optiosn page like normal plugins? Then, include the options page as a theme include, then ACF, then swap to your theme.
At what point does the issue happen?
I’ve stumbled across this problem too. It arises when I try to add an item to the admin nav.
It happens when I add the following code to my functions.php:
add_action('admin_menu', 'create_info_link');
function create_info_link() {
add_object_page(
'Info',
'Info',
'administrator',
'post.php?post=60&action=edit'
);
}
Same problem
if (function_exists( "acf_add_options_sub_page" ))
acf_add_options_sub_page("Global Options");
Looks like it still creates an options page but it’s not correct.
Hi @djbokka
Thanks for the info. I’ve got no idea why this is happening and I can’t replicate the issue on my end.
Are you able to hop into the add-on code and debug the issue starting with the acf_add_options_sub_page function?
Thanks mate
Cheers
E
I’ve had the same problem after the last update of the plugin. So I did a lot of different tests and it seems there is a issue with the add_action WordPress function.
The thing that causes the admin menu not to show is this line (acf-options-page.php line 44):
add_action('init', array($this,'init'), 1);
It seems the whole thing breaks as this init add_action has a priority set as 1, while another init add_action in the acf.php file (line 81) is also set as 1 in priority. So if one simply change the priority of the init add_action function in the acf-options-page.php file to 2, it all works.
Hope it works.
Daniel
If I change the init priority in my function (that’s calling acf_add_options_sub_page
) to 0, it works.
Hi guys
the function acf_add_options_sub_page was designed to run in the root of the functions.php file.
The issue must be caused by running the function later, which bypasses the core validation!!
Perhaps I can edit the priority of the admin_head action to 999, so it always runs after anyone elses?
I could try that. We have our framework plugin that we install on every site we build. Included in that framework is setting up and configuring options. We rely on the ability to call it outside of the functions.php file.
UPDATE: looks like that works. Our plugin (I suspect like most others) just uses the default priority on init.
Doesn’t seem to work if i change the priority of the admin_head action to 999.
No matter what I do, the only thing that seems to be working is to change the priority of the init action in the acf_options_page.php file. The priority can be anything (2, 3, 100 or just nothing), as long as it isn’t 1. That’s my usercase.
I’ve tried this on a completely empty a freshly installed WordPress (tried version 3.6 and the new version 3.7) with an empty template using only the advanced custom fields plugin with the three add-ons: Repeater, Flexible Content and Options Page.
The topic ‘Options Page Disappeared’ is closed to new replies.
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.