Make WordPress Core


Ignore:
Timestamp:
11/29/2013 09:00:23 AM (12 years ago)
Author:
dd32
Message:

Themes: Do extra Cap checks before outputting links, and use full URI's. See #25948

File:
1 edited

Legend:

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

    r26462 r26470  
    9393    'settings' => array(
    9494        'canInstall'    => ( ! is_multisite() && current_user_can( 'install_themes' ) ),
    95         'installURI'    => admin_url( 'theme-install.php' ),
    96         'customizeURI'  => ( current_user_can( 'edit_theme_options' ) ) ? wp_customize_url() : null,
     95        'installURI'    => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null,
    9796        'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ),
    98         'root'          => '/wp-admin/themes.php',
     97        'root'          => admin_url( 'themes.php' ),
    9998        'extraRoutes'   => '',
    10099    ),
     
    221220    <div class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></div>
    222221    <h3 class="theme-name">{{ data.name }}</h3>
     222
    223223    <div class="theme-actions">
    224224
    225225    <# if ( data.active ) { #>
    226         <span class="current-label"><?php _e( 'Current Theme' ); ?></span>
    227         <# if ( wp.themes.data.settings['customizeURI'] ) { #>
    228             <a class="button button-primary hide-if-no-customize" href="{{ wp.themes.data.settings['customizeURI'] }}"><?php _e( 'Customize' ); ?></a>
     226        <# if ( data.actions['customize'] ) { #>
     227            <a class="button button-primary hide-if-no-customize" href="{{ data.actions['customize'] }}"><?php _e( 'Customize' ); ?></a>
    229228        <# } #>
    230229    <# } else { #>
     
    293292        <div class="active-theme">
    294293            <a href="{{{ wp.themes.data.settings.customizeURI }}}" class="button button-primary hide-if-no-customize"><?php _e( 'Customize' ); ?></a>
    295             <?php if( current_theme_supports( 'menus' ) ) { ?>
     294            <?php if ( current_theme_supports( 'menus' ) ) { ?>
    296295            <a class="button button-secondary" href="<?php echo admin_url( 'nav-menus.php' ); ?>"><?php _e( 'Menus' ); ?></a>
    297296            <?php } ?>
     
    301300        </div>
    302301        <div class="inactive-theme">
    303             <a href="{{{ data.actions.activate }}}" class="button button-primary"><?php _e( 'Activate' ); ?></a>
     302            <# if ( data.actions.activate ) { #>
     303                <a href="{{{ data.actions.activate }}}" class="button button-primary"><?php _e( 'Activate' ); ?></a>
     304            <# } #>
    304305            <a href="{{{ data.actions.customize }}}" class="button button-secondary"><?php _e( 'Live Preview' ); ?></a>
    305306        </div>
    306307
    307         <# if ( ! data.active ) { #>
     308        <# if ( ! data.active && data.actions.delete ) { #>
    308309            <a href="{{{ data.actions.delete }}}" class="delete-theme"><?php _e( 'Delete' ); ?></a>
    309310        <# } #>
Note: See TracChangeset for help on using the changeset viewer.