Changeset 26726 for trunk/src/wp-admin/includes/theme.php
- Timestamp:
- 12/06/2013 04:10:25 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/theme.php
r26711 r26726 379 379 */ 380 380 function wp_prepare_themes_for_js( $themes = null ) { 381 $prepared_themes = array();382 381 $current_theme = get_stylesheet(); 382 383 // Make sure the current theme is listed first. 384 $prepared_themes = array( $current_theme => array() ); 383 385 384 386 if ( null === $themes ) { … … 407 409 $encoded_slug = urlencode( $slug ); 408 410 409 $prepared_themes[ ] = array(411 $prepared_themes[ $slug ] = array( 410 412 'id' => $slug, 411 413 'name' => $theme->display( 'Name' ), … … 423 425 'activate' => current_user_can( 'switch_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=activate&stylesheet=' . $encoded_slug ), 'switch-theme_' . $slug ) : null, 424 426 'customize'=> current_user_can( 'edit_theme_options' ) ? wp_customize_url( $slug ) : null, 427 'preview' => add_query_arg( array( 428 'preview' => 1, 429 'template' => urlencode( $theme->get_template() ), 430 'stylesheet' => urlencode( $slug ), 431 'preview_iframe' => true, 432 'TB_iframe' => true, 433 ), home_url( '/' ) ), 425 434 'delete' => current_user_can( 'delete_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null, 426 435 ), … … 437 446 * @param array $prepared_themes Array of themes. 438 447 */ 439 return apply_filters( 'wp_prepare_themes_for_js', $prepared_themes ); 440 } 448 $prepared_themes = apply_filters( 'wp_prepare_themes_for_js', $prepared_themes ); 449 return array_values( $prepared_themes ); 450 }
Note: See TracChangeset
for help on using the changeset viewer.