Home › Forums › Backend Issues (wp-admin) › Permissions error on Options screens
Hello there! I went to work on the admin screens for a client’s project today and ran into a permissions error when attempting to access a custom Options page:
“You do not have sufficient permissions to access this page.”
Two things have happened since it was last working:
– We moved the site and database over to a new server
– I’ve upgraded up several versions of ACF (I don’t recall exact versions but can probably figure it out)
I went to the groups interface and attempted to re-assign the group to the particular panel causing the error. No success. Re-assigning worked for other groups to their respective panels.
What I noticed is that the permalink structure for the panel’s changed.
Previously, the URL was:
Now it is:
I presume that change may be related to the issue.
Any ideas? Let me know if you’d like admin access to the installation in question.
Hi @Jonathan Wold
What code are you using to register the options page?
In the above example we’re using:
I have that within a plugin class that triggers on init.
It’s possible that running the code on init is causing the issue and it may need to run before hand.
I’ll add this to the to-do and let you know what I find
Thanks for the follow-up, Elliot!
Would that explain why some options screens setup with that method work and some don’t? (I probably have more than 10 setup) There didn’t seem to be a clear explanation.
Hi @Jonathan Wold
Perhaps you can post the code for registering all pages, and list which ones work and which don’t.
It appears that there may be a bug in the sanitization process. Upon closer inspection the only pages having issues were those with a space in the title.
I fixed it by declaring a slug:
acf_add_options_sub_page(array( 'title' => 'Nearby Properties', 'slug' => 'nearby-properties', ));
The topic ‘Permissions error on Options screens’ 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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.