Make WordPress Core


Ignore:
Timestamp:
12/02/2013 06:45:28 PM (11 years ago)
Author:
nacin
Message:

Themes: Always include the current theme in the list, even if it is not allowed.

see #25948.

File:
1 edited

Legend:

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

    r26470 r26529  
    377377 */
    378378function wp_prepare_themes_for_js( $themes = null ) {
     379    $prepared_themes = array();
     380    $current_theme = get_stylesheet();
     381
    379382    if ( null === $themes ) {
    380383        $themes = wp_get_themes( array( 'allowed' => true ) );
    381     }
    382 
    383     $prepared_themes = array();
    384     $current_theme = get_stylesheet();
     384        if ( ! isset( $themes[ $current_theme ] ) ) {
     385            $themes[ $current_theme ] = wp_get_theme();
     386        }
     387    }
    385388
    386389    $updates = array();
     
    416419            'actions'      => array(
    417420                '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,
     421                'customize'=> current_user_can( 'edit_theme_options' ) ? wp_customize_url( $slug ) : null,
    419422                'delete'   => current_user_can( 'delete_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null,
    420423            ),
Note: See TracChangeset for help on using the changeset viewer.