Ticket #20027: 20027.patch

File 20027.patch, 6.9 KB (added by ocean90, 15 months ago)
  • wp-includes/update.php

     
    248248        $exclude_fields = array('Template Files', 'Stylesheet Files', 'Status', 'Theme Root', 'Theme Root URI', 'Template Dir', 'Stylesheet Dir', 'Description', 'Tags', 'Screenshot'); 
    249249 
    250250        // Put slug of current theme into request. 
    251         $themes['current_theme'] = get_option( 'stylesheet' ); 
     251        $themes['current_theme'] = get_stylesheet(); 
    252252 
    253253        foreach ( (array) $installed_themes as $theme_title => $theme ) { 
    254254                $themes[$theme['Stylesheet']] = array(); 
  • wp-includes/theme.php

     
    522522 
    523523        if ( $themes ) { 
    524524                $theme_names = array_keys( $themes ); 
    525                 $current_template = get_option( 'template' ); 
    526                 $current_stylesheet = get_option( 'stylesheet' ); 
     525                $current_template = get_template(); 
     526                $current_stylesheet = get_stylesheet(); 
    527527 
    528528                foreach ( (array) $theme_names as $theme_name ) { 
    529529                        if ( $themes[$theme_name]['Stylesheet'] == $current_stylesheet && 
     
    713713 
    714714        // If requesting the root for the current theme, consult options to avoid calling get_theme_roots() 
    715715        if ( !$no_cache ) { 
    716                 if ( get_option('stylesheet') == $stylesheet_or_template ) 
     716                if ( get_stylesheet() == $stylesheet_or_template ) 
    717717                        $theme_root = get_option('stylesheet_root'); 
    718                 elseif ( get_option('template') == $stylesheet_or_template ) 
     718                elseif ( get_template() == $stylesheet_or_template ) 
    719719                        $theme_root = get_option('template_root'); 
    720720        } 
    721721 
     
    13181318 * @return array Theme modifications. 
    13191319 */ 
    13201320function get_theme_mods() { 
    1321         $theme_slug = get_option( 'stylesheet' ); 
     1321        $theme_slug = get_stylesheet(); 
    13221322        if ( false === ( $mods = get_option( "theme_mods_$theme_slug" ) ) ) { 
    13231323                $theme_name = get_current_theme(); 
    13241324                $mods = get_option( "mods_$theme_name" ); // Deprecated location. 
     
    13701370 
    13711371        $mods[ $name ] = $value; 
    13721372 
    1373         $theme = get_option( 'stylesheet' ); 
     1373        $theme = get_stylesheet(); 
    13741374        update_option( "theme_mods_$theme", $mods ); 
    13751375} 
    13761376 
     
    13961396        if ( empty( $mods ) ) 
    13971397                return remove_theme_mods(); 
    13981398 
    1399         $theme = get_option( 'stylesheet' ); 
     1399        $theme = get_stylesheet(); 
    14001400        update_option( "theme_mods_$theme", $mods ); 
    14011401} 
    14021402 
     
    14061406 * @since 2.1.0 
    14071407 */ 
    14081408function remove_theme_mods() { 
    1409         delete_option( 'theme_mods_' . get_option( 'stylesheet' ) ); 
     1409        delete_option( 'theme_mods_' . get_stylesheet() ); 
    14101410        delete_option( 'mods_' . get_current_theme() ); 
    14111411} 
    14121412 
     
    15651565        $header_images = array(); 
    15661566 
    15671567        // @todo caching 
    1568         $headers = get_posts( array( 'post_type' => 'attachment', 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' => get_option('stylesheet'), 'orderby' => 'none', 'nopaging' => true ) ); 
     1568        $headers = get_posts( array( 'post_type' => 'attachment', 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' => get_stylesheet(), 'orderby' => 'none', 'nopaging' => true ) ); 
    15691569 
    15701570        if ( empty( $headers ) ) 
    15711571                return array(); 
  • wp-admin/includes/class-wp-ms-themes-list-table.php

     
    287287                if ( current_user_can('edit_themes') ) 
    288288                        $actions['edit'] = '<a href="' . esc_url('theme-editor.php?theme=' . urlencode( $theme['Name'] )) . '" title="' . esc_attr__('Open this theme in the Theme Editor') . '" class="edit">' . __('Edit') . '</a>'; 
    289289 
    290                 if ( empty( $theme['enabled'] ) && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $theme_key != get_option( 'stylesheet' ) && $theme_key != get_option( 'template' ) ) 
     290                if ( empty( $theme['enabled'] ) && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $theme_key != get_stylesheet() && $theme_key != get_template() ) 
    291291                        $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=delete-selected&amp;checked[]=' . $theme_key . '&amp;theme_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-themes' ) ) . '" title="' . esc_attr__( 'Delete this theme' ) . '" class="delete">' . __( 'Delete' ) . '</a>'; 
    292292 
    293293                $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme_key, $theme, $context ); 
  • wp-admin/includes/schema.php

     
    841841                return $errors; 
    842842 
    843843        // set up site tables 
    844         $template = get_option( 'template' ); 
    845         $stylesheet = get_option( 'stylesheet' ); 
     844        $template = get_template(); 
     845        $stylesheet = get_stylesheet(); 
    846846        $allowed_themes = array( $stylesheet => true ); 
    847847        if ( $template != $stylesheet ) 
    848848                $allowed_themes[ $template ] = true; 
  • wp-admin/includes/template.php

     
    14851485 
    14861486function _media_states( $post ) { 
    14871487        $media_states = array(); 
    1488         $stylesheet = get_option('stylesheet'); 
     1488        $stylesheet = get_stylesheet(); 
    14891489 
    14901490        if ( current_theme_supports( 'custom-header') ) { 
    14911491                $meta_header = get_post_meta($post->ID, '_wp_attachment_is_custom_header', true ); 
  • wp-admin/theme-editor.php

     
    241241        <?php } ?> 
    242242 
    243243                <div> 
    244                 <?php if ( is_child_theme() && ! $is_child_theme && $themes[$theme]['Template'] == get_option('template') ) : ?> 
     244                <?php if ( is_child_theme() && ! $is_child_theme && $themes[$theme]['Template'] == get_template() ) : ?> 
    245245                        <p><?php if ( is_writeable( $file ) ) { ?><strong><?php _e( 'Caution:' ); ?></strong><?php } ?> 
    246246                        <?php _e( 'This is a file in your current parent theme.' ); ?></p> 
    247247                <?php endif; ?> 
  • wp-admin/network/themes.php

     
    110110 
    111111                        $themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array(); 
    112112 
    113                         if ( isset( $themes[ get_option( 'template' ) ] ) ) 
    114                                 unset( $themes[ get_option( 'template' ) ] ); 
    115                         if ( isset( $themes[ get_option( 'stylesheet' ) ] ) ) 
    116                                 unset( $themes[ get_option( 'stylesheet' ) ] ); 
     113                        if ( isset( $themes[ get_template() ] ) ) 
     114                                unset( $themes[ get_template() ] ); 
     115                        if ( isset( $themes[ get_stylesheet() ] ) ) 
     116                                unset( $themes[ get_stylesheet() ] ); 
    117117 
    118118                        if ( empty( $themes ) ) { 
    119119                                wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );