-
Notifications
You must be signed in to change notification settings - Fork 37
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
[New Sniff] Check for removal of admin pages #17
Comments
Discussed in the meeting of May 31st, let's add this. |
To create this sniff, I need some more information about the WP Core admin pages which are not supposed to be removed. The question is basically: which submenu items are allowed to be removed ? Answers I can think of:
|
Essentially, the only admin pages allowed to be removed would be custom Appearance submenu items created by a parent theme and removed by a child theme. I can't think of any others we allow to be removed. I'm not even sure that there's a child theme that does this in the directory. The situation would be rare. |
I would go with
I agree with Justin. |
Thanks for the feedback. I have the sniff nearly ready already, but won't be able to get back to it until the weekend. |
@jrfnl is this a different sniff from the forbidden functions one? |
Yes it is and a lot more complicated one. Themes can remove admin pages from, for instance, a parent theme, but they are not allowed to remove WP Core admin pages, so there is a lot more involved in that. I worked on it last year and it's quite tricky. I'd need to have a good look again to see where I got stuck. |
I've removed the input/decision needed, as we know what is and isn't allowed. |
Rule:
Removal of WP admin pages is not allowed.
The exception would be a child theme removing a theme admin submenu page added by the parent theme.
Ref: #12 (comment)
Theme check file covering this rule:
n/a
Decision needed:
This is currently not in the handbook as a rule. Should it be one ?
Notes for implementation:
remove_menu_page()
and forbid this.remove_submenu_page()
and only forbid this if one of a known list of WP Core admin pages is being removedTo do:
The text was updated successfully, but these errors were encountered: