Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should there be a check for removal of admin pages ? #12

Closed
jrfnl opened this issue Jul 11, 2016 · 2 comments
Closed

Should there be a check for removal of admin pages ? #12

jrfnl opened this issue Jul 11, 2016 · 2 comments

Comments

@jrfnl
Copy link

jrfnl commented Jul 11, 2016

As described in #11, themes should use add_theme_page() and are not allowed to use the other add_.._page() functions.

In that same category of functions there are two functions which remove menu pages: remove_menu_page() and remove_submenu_page().

Is it ok to use these in a theme or should these be forbidden as well ?

Ref: https://codex.wordpress.org/Administration_Menus

@justintadlock
Copy link

There's probably never a legit reason for themes to use remove_menu_page().

There's probably a few reasons to allow for remove_submenu_page( 'themes.php' ), but that should check to make sure it's not a core sub-menu item (e.g. customize.php). Most likely, the only real use case here is removing a sub-menu item that a parent theme has added via a child theme.

It's rare that we have a theme attempting to remove pages though.

@jrfnl
Copy link
Author

jrfnl commented Jul 11, 2016

Ok, thanks for the response. I'll add a proper new sniff issue and tag it as low priority. Ok ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants