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/themes.php

    r28890 r29170  
    6868
    6969// Help tab: Previewing and Customizing
    70 if ( current_user_can( 'edit_theme_options' ) ) {
     70if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
    7171    $help_customize =
    7272        '<p>' . __( 'Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.' ) . '</p>'.
     
    7979        'content'   => $help_customize
    8080    ) );
    81 } // edit_theme_options
     81} // edit_theme_options && customize
    8282
    8383get_current_screen()->set_help_sidebar(
     
    213213
    214214    <?php if ( $theme['active'] ) { ?>
    215         <?php if ( $theme['actions']['customize'] ) { ?>
     215        <?php if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
    216216            <a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a>
    217217        <?php } ?>
    218218    <?php } else { ?>
    219219        <a class="button button-primary activate" href="<?php echo $theme['actions']['activate']; ?>"><?php _e( 'Activate' ); ?></a>
    220         <a class="button button-secondary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a>
    221         <a class="button button-secondary hide-if-customize" href="<?php echo $theme['actions']['preview']; ?>"><?php _e( 'Preview' ); ?></a>
     220        <?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
     221            <a class="button button-secondary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a>
     222            <a class="button button-secondary hide-if-customize" href="<?php echo $theme['actions']['preview']; ?>"><?php _e( 'Preview' ); ?></a>
     223        <?php } ?>
    222224    <?php } ?>
    223225
Note: See TracChangeset for help on using the changeset viewer.