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..b471f4e 100644
|
|
if ( $tab ) { |
275 | 275 | </div> |
276 | 276 | |
277 | 277 | <div class="theme-id-container"> |
278 | | <h3 class="theme-name">{{ data.name }}</h3> |
| 278 | <# if ( data.active ) { #> |
| 279 | <h3 class="theme-name"> |
| 280 | <?php |
| 281 | /* translators: %s: Theme name */ |
| 282 | printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' ); |
| 283 | ?> |
| 284 | </h3> |
| 285 | <# } else { #> |
| 286 | <h3 class="theme-name">{{ data.name }}</h3> |
| 287 | <# } #> |
279 | 288 | |
280 | 289 | <div class="theme-actions"> |
281 | 290 | <# if ( data.installed ) { #> |
… |
… |
if ( $tab ) { |
283 | 292 | /* translators: %s: Theme name */ |
284 | 293 | $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); |
285 | 294 | ?> |
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> |
| 295 | <# if ( ! data.active ) { #> |
| 296 | <# if ( data.activate_url ) { #> |
| 297 | <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> |
| 298 | <# } #> |
| 299 | <# if ( data.customize_url ) { #> |
| 300 | <a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a> |
| 301 | <# } else { #> |
| 302 | <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> |
| 303 | <# } #> |
291 | 304 | <# } else { #> |
292 | | <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> |
| 305 | <# if ( data.customize_url ) { #> |
| 306 | <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.customize_url }}}"><?php _e( 'Customize' ); ?></a> |
| 307 | <# } #> |
293 | 308 | <# } #> |
294 | 309 | <# } else { #> |
295 | 310 | <?php |
… |
… |
if ( $tab ) { |
314 | 329 | <button class="previous-theme"><span class="screen-reader-text"><?php _e( 'Previous theme' ); ?></span></button> |
315 | 330 | <button class="next-theme"><span class="screen-reader-text"><?php _e( 'Next theme' ); ?></span></button> |
316 | 331 | <# if ( data.installed ) { #> |
317 | | <a class="button button-primary activate" href="{{ data.activate_url }}"><?php _e( 'Activate' ); ?></a> |
| 332 | <# if ( ! data.active ) { #> |
| 333 | <a class="button button-primary activate" href="{{ data.activate_url }}"><?php _e( 'Activate' ); ?></a> |
| 334 | <# } #> |
318 | 335 | <# } else { #> |
319 | 336 | <a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a> |
320 | 337 | <# } #> |
321 | 338 | </div> |
322 | 339 | <div class="wp-full-overlay-sidebar-content"> |
323 | 340 | <div class="install-theme-info"> |
324 | | <h3 class="theme-name">{{ data.name }}</h3> |
| 341 | <# if ( data.active ) { #> |
| 342 | <h3 class="theme-name"> |
| 343 | <?php |
| 344 | /* translators: %s: Theme name */ |
| 345 | printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' ); |
| 346 | ?> |
| 347 | </h3> |
| 348 | <# } else { #> |
| 349 | <h3 class="theme-name">{{ data.name }}</h3> |
| 350 | <# } #> |
325 | 351 | <span class="theme-by"> |
326 | 352 | <?php |
327 | 353 | /* translators: %s: Theme author name */ |