Ability to set permission level for admin settings pages using filters
|Reported by:||bananastalktome||Owned by:|
Removing admin pages from the menu tree is made possible through using either the $submenu global or the remove_submenu_page function, however preventing users from manually accessing the page is not an easy endeavor (afaik). Rather than hard-coding in the minimum role, would it make better sense to utilize filters to allow developers to change the privilege?
For example, a change on line 13 of wp-admin/options-discussion.php:
- if ( ! current_user_can( 'manage_options' ) ) + if ( ! current_user_can( apply_filters('admin_options_discussion_page_privilege', 'manage_options') ) )
Removing access to this page would then be as easy as add_filter('admin_options_discussion_page_privilege', create_function('', 'return "manage_network";')); , for example.
Change History (10)
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed