Changeset 26470
- Timestamp:
- 11/29/2013 09:00:23 AM (11 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/theme.php
r26469 r26470 143 143 $theme_name = $theme->display('Name'); 144 144 $details_url = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']); //Theme browser inside WP? replace this, Also, theme preview JS will override this on the available list. 145 $update_url = wp_nonce_url( 'update.php?action=upgrade-theme&theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet);145 $update_url = wp_nonce_url( admin_url( 'update.php?action=upgrade-theme&theme=' . urlencode( $stylesheet ) ), 'upgrade-theme_' . $stylesheet ); 146 146 $update_onclick = 'onclick="if ( confirm(\'' . esc_js( __("Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.") ) . '\') ) {return true;}return false;"'; 147 147 … … 415 415 'update' => get_theme_update_available( $theme ), 416 416 'actions' => array( 417 'activate' => wp_nonce_url( 'themes.php?action=activate&stylesheet=' . $encoded_slug, 'switch-theme_' . $slug ),418 'customize'=> admin_url( 'customize.php?theme=' . $encoded_slug ),419 'delete' => wp_nonce_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug, 'delete-theme_' . $slug ),417 'activate' => current_user_can( 'switch_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=activate&stylesheet=' . $encoded_slug ), 'switch-theme_' . $slug ) : null, 418 'customize'=> current_user_can( 'edit_theme_options' ) ? admin_url( 'customize.php?theme=' . $encoded_slug ) : null, 419 'delete' => current_user_can( 'delete_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null, 420 420 ), 421 421 ); -
trunk/src/wp-admin/themes.php
r26462 r26470 93 93 'settings' => array( 94 94 '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, 97 96 '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' ), 99 98 'extraRoutes' => '', 100 99 ), … … 221 220 <div class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></div> 222 221 <h3 class="theme-name">{{ data.name }}</h3> 222 223 223 <div class="theme-actions"> 224 224 225 225 <# 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> 229 228 <# } #> 230 229 <# } else { #> … … 293 292 <div class="active-theme"> 294 293 <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' ) ) { ?> 296 295 <a class="button button-secondary" href="<?php echo admin_url( 'nav-menus.php' ); ?>"><?php _e( 'Menus' ); ?></a> 297 296 <?php } ?> … … 301 300 </div> 302 301 <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 <# } #> 304 305 <a href="{{{ data.actions.customize }}}" class="button button-secondary"><?php _e( 'Live Preview' ); ?></a> 305 306 </div> 306 307 307 <# if ( ! data.active ) { #>308 <# if ( ! data.active && data.actions.delete ) { #> 308 309 <a href="{{{ data.actions.delete }}}" class="delete-theme"><?php _e( 'Delete' ); ?></a> 309 310 <# } #>
Note: See TracChangeset
for help on using the changeset viewer.