Make WordPress Core


Ignore:
Timestamp:
07/14/2014 07:00:24 PM (12 years ago)
Author:
ocean90
Message:

Customizer: Add meta capability customize which is mapped to edit_theme_options.

You can now allow users to access the Customizer, say for any user who can edit_posts, via map_meta_cap or user_has_cap filter. See ticket for examples.

props westonruter, nacin.
fixes #28605.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r29135 r29170  
    1313require_once( dirname( __FILE__ ) . '/admin.php' );
    1414
    15 if ( ! current_user_can( 'edit_theme_options' ) ) {
     15if ( ! current_user_can( 'customize' ) ) {
    1616    wp_die( __( 'Cheatin’ uh?' ) );
    1717}
     
    2525}
    2626if ( ! $return ) {
    27     $return = $url;
     27    if ( $url ) {
     28        $return = $url;
     29    } elseif ( current_user_can( 'edit_theme_options' ) || current_user_can( 'switch_themes' ) ) {
     30        $return = admin_url( 'themes.php' );
     31    } else {
     32        $return = admin_url();
     33    }
    2834}
    2935
     
    113119            ?>
    114120            <span class="spinner"></span>
    115             <a class="customize-controls-close" href="<?php echo esc_url( $return ? $return : admin_url( 'themes.php' ) ); ?>">
     121            <a class="customize-controls-close" href="<?php echo esc_url( $return ); ?>">
    116122                <span class="screen-reader-text"><?php _e( 'Cancel' ); ?></span>
    117123            </a>
Note: See TracChangeset for help on using the changeset viewer.