[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 15:56:45 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 nacin):

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

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


More information about the wp-trac mailing list