WordPress.org

Make WordPress Core

Changeset 17986


Ignore:
Timestamp:
05/22/11 21:32:22 (3 years ago)
Author:
nacin
Message:

Add option_page_capability_$option_page filter. see #14365.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options.php

    r17748 r17986  
    2525wp_reset_vars(array('action', 'option_page')); 
    2626 
     27$capability = 'manage_options'; 
     28 
    2729if ( empty($option_page) ) // This is for back compat and will eventually be removed. 
    2830    $option_page = 'options'; 
    29  
    30 if ( !current_user_can('manage_options') ) 
     31else 
     32    $capability = apply_filters( "option_page_capability_{$option_page}", $capability ); 
     33 
     34if ( !current_user_can( $capability ) ) 
    3135    wp_die(__('Cheatin’ uh?')); 
    3236 
Note: See TracChangeset for help on using the changeset viewer.