[wp-trac] [WordPress Trac] #20111: Ability to set permission level for admin settings pages using filters

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 24 16:02:56 UTC 2012


#20111: Ability to set permission level for admin settings pages using filters
-----------------------------+------------------------------
 Reporter:  bananastalktome  |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Administration   |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+------------------------------

Comment (by bananastalktome):

 Replying to [comment:1 nacin]:
 > You can do something like this:
 > {{{
 > add_filter( 'map_meta_cap', function( $caps, $cap ) {
 >    if ( $cap == 'manage_options' )
 >       $caps[] = 'manage_network';
 >    return $caps;
 > } );
 > }}}

 The problem with this approach (correct me if I am wrong) is that I do not
 want `'manage_options'` to map to `'manage_network'` in all places since
 there are many places WordPress (as well as plugins) uses
 `'manage_options'`. The desired effect is to be able to remove access to a
 particular options page without impacting anything else (more desirable
 would be to remove individual options on some pages rather than the entire
 page, but that's a story for another day ;) ).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20111#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list