diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
index db22db2..ccc880b 100644
|
|
|
function wp_ajax_query_themes() { |
| 3213 | 3213 | wp_send_json_error(); |
| 3214 | 3214 | } |
| 3215 | 3215 | |
| | 3216 | $current_theme = get_stylesheet(); |
| | 3217 | |
| 3216 | 3218 | $update_php = network_admin_url( 'update.php?action=install-theme' ); |
| 3217 | 3219 | foreach ( $api->themes as &$theme ) { |
| 3218 | 3220 | $theme->install_url = add_query_arg( |
| … |
… |
function wp_ajax_query_themes() { |
| 3268 | 3270 | ); |
| 3269 | 3271 | $theme->num_ratings = number_format_i18n( $theme->num_ratings ); |
| 3270 | 3272 | $theme->preview_url = set_url_scheme( $theme->preview_url ); |
| | 3273 | $theme->active = ( $theme->slug === $current_theme ); |
| 3271 | 3274 | } |
| 3272 | 3275 | |
| 3273 | 3276 | wp_send_json_success( $api ); |
diff --git src/wp-admin/theme-install.php src/wp-admin/theme-install.php
index 369cb87..7489272 100644
|
|
|
if ( $tab ) { |
| 275 | 275 | </div> |
| 276 | 276 | |
| 277 | 277 | <div class="theme-id-container"> |
| 278 | | <h3 class="theme-name">{{ data.name }}</h3> |
| 279 | | |
| 280 | | <div class="theme-actions"> |
| 281 | | <# if ( data.installed ) { #> |
| | 278 | <# if ( data.active ) { #> |
| | 279 | <h3 class="theme-name"> |
| 282 | 280 | <?php |
| 283 | 281 | /* translators: %s: Theme name */ |
| 284 | | $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); |
| | 282 | printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' ); |
| 285 | 283 | ?> |
| 286 | | <# if ( data.activate_url ) { #> |
| 287 | | <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> |
| 288 | | <# } #> |
| 289 | | <# if ( data.customize_url ) { #> |
| 290 | | <a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a> |
| | 284 | </h3> |
| | 285 | <# } else { #> |
| | 286 | <h3 class="theme-name">{{ data.name }}</h3> |
| | 287 | <# } #> |
| | 288 | |
| | 289 | <div class="theme-actions"> |
| | 290 | <# if ( data.installed ) { #> |
| | 291 | <# if ( ! data.active ) { #> |
| | 292 | <# if ( data.activate_url ) { #> |
| | 293 | <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> |
| | 294 | <# } #> |
| | 295 | <# if ( data.customize_url ) { #> |
| | 296 | <a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a> |
| | 297 | <# } else { #> |
| | 298 | <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> |
| | 299 | <# } #> |
| 291 | 300 | <# } else { #> |
| 292 | | <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> |
| | 301 | <# if ( data.customize_url ) { #> |
| | 302 | <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.customize_url }}}"><?php _e( 'Customize' ); ?></a> |
| | 303 | <# } #> |
| 293 | 304 | <# } #> |
| 294 | 305 | <# } else { #> |
| 295 | 306 | <?php |
| … |
… |
if ( $tab ) { |
| 314 | 325 | <button class="previous-theme"><span class="screen-reader-text"><?php _e( 'Previous theme' ); ?></span></button> |
| 315 | 326 | <button class="next-theme"><span class="screen-reader-text"><?php _e( 'Next theme' ); ?></span></button> |
| 316 | 327 | <# if ( data.installed ) { #> |
| 317 | | <a class="button button-primary activate" href="{{ data.activate_url }}"><?php _e( 'Activate' ); ?></a> |
| | 328 | <# if ( ! data.active ) { #> |
| | 329 | <a class="button button-primary activate" href="{{ data.activate_url }}"><?php _e( 'Activate' ); ?></a> |
| | 330 | <# } #> |
| 318 | 331 | <# } else { #> |
| 319 | 332 | <a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a> |
| 320 | 333 | <# } #> |
| 321 | 334 | </div> |
| 322 | 335 | <div class="wp-full-overlay-sidebar-content"> |
| 323 | 336 | <div class="install-theme-info"> |
| 324 | | <h3 class="theme-name">{{ data.name }}</h3> |
| | 337 | <# if ( data.active ) { #> |
| | 338 | <h3 class="theme-name"> |
| | 339 | <?php |
| | 340 | /* translators: %s: Theme name */ |
| | 341 | printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' ); |
| | 342 | ?> |
| | 343 | </h3> |
| | 344 | <# } else { #> |
| | 345 | <h3 class="theme-name">{{ data.name }}</h3> |
| | 346 | <# } #> |
| 325 | 347 | <span class="theme-by"> |
| 326 | 348 | <?php |
| 327 | 349 | /* translators: %s: Theme author name */ |