Ticket #20027: 20027.2.patch
| File 20027.2.patch, 8.8 KB (added by , 14 years ago) |
|---|
-
wp-includes/class-wp-customize.php
83 83 add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) ); 84 84 add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) ); 85 85 86 // @link: http://core.trac.wordpress.org/ticket/2002787 add_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );88 add_filter( 'pre_option_template', array( $this, 'get_template' ) );89 90 86 // Handle custom theme roots. 91 87 if ( count( $wp_theme_directories ) > 1 ) { 92 88 add_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) ); -
wp-includes/theme.php
554 554 555 555 // If requesting the root for the current theme, consult options to avoid calling get_theme_roots() 556 556 if ( ! $skip_cache ) { 557 if ( get_ option('stylesheet') == $stylesheet_or_template )557 if ( get_stylesheet() == $stylesheet_or_template ) 558 558 $theme_root = get_option('stylesheet_root'); 559 elseif ( get_ option('template') == $stylesheet_or_template )559 elseif ( get_template() == $stylesheet_or_template ) 560 560 $theme_root = get_option('template_root'); 561 561 } 562 562 … … 615 615 } 616 616 617 617 // Prevent theme mods to current theme being used on theme being previewed 618 add_filter( 'pre_option_theme_mods_' . get_ option( 'stylesheet'), '__return_empty_array' );618 add_filter( 'pre_option_theme_mods_' . get_stylesheet(), '__return_empty_array' ); 619 619 620 620 ob_start( 'preview_theme_ob_filter' ); 621 621 } … … 771 771 * @return array Theme modifications. 772 772 */ 773 773 function get_theme_mods() { 774 $theme_slug = get_ option( 'stylesheet');774 $theme_slug = get_stylesheet(); 775 775 if ( false === ( $mods = get_option( "theme_mods_$theme_slug" ) ) ) { 776 776 $theme_name = get_option( 'current_theme' ); 777 777 if ( false === $theme_name ) … … 825 825 826 826 $mods[ $name ] = $value; 827 827 828 $theme = get_ option( 'stylesheet');828 $theme = get_stylesheet(); 829 829 update_option( "theme_mods_$theme", $mods ); 830 830 } 831 831 … … 851 851 if ( empty( $mods ) ) 852 852 return remove_theme_mods(); 853 853 854 $theme = get_ option( 'stylesheet');854 $theme = get_stylesheet(); 855 855 update_option( "theme_mods_$theme", $mods ); 856 856 } 857 857 … … 861 861 * @since 2.1.0 862 862 */ 863 863 function remove_theme_mods() { 864 delete_option( 'theme_mods_' . get_ option( 'stylesheet') );864 delete_option( 'theme_mods_' . get_stylesheet() ); 865 865 866 866 // Old style. 867 867 $theme_name = get_option( 'current_theme' ); … … 1025 1025 $header_images = array(); 1026 1026 1027 1027 // @todo caching 1028 $headers = get_posts( array( 'post_type' => 'attachment', 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' => get_ option('stylesheet'), 'orderby' => 'none', 'nopaging' => true ) );1028 $headers = get_posts( array( 'post_type' => 'attachment', 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' => get_stylesheet(), 'orderby' => 'none', 'nopaging' => true ) ); 1029 1029 1030 1030 if ( empty( $headers ) ) 1031 1031 return array(); -
wp-admin/includes/class-wp-ms-themes-list-table.php
287 287 if ( current_user_can('edit_themes') ) 288 288 $actions['edit'] = '<a href="' . esc_url('theme-editor.php?theme=' . $theme_key ) . '" title="' . esc_attr__('Open this theme in the Theme Editor') . '" class="edit">' . __('Edit') . '</a>'; 289 289 290 if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $theme_key != get_ option( 'stylesheet' ) && $theme_key != get_option( 'template') )290 if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $theme_key != get_stylesheet() && $theme_key != get_template() ) 291 291 $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=delete-selected&checked[]=' . $theme_key . '&theme_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-themes' ) ) . '" title="' . esc_attr__( 'Delete this theme' ) . '" class="delete">' . __( 'Delete' ) . '</a>'; 292 292 293 293 $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme_key, $theme, $context ); -
wp-admin/includes/schema.php
838 838 return $errors; 839 839 840 840 // set up site tables 841 $template = get_ option( 'template');842 $stylesheet = get_ option( 'stylesheet');841 $template = get_template(); 842 $stylesheet = get_stylesheet(); 843 843 $allowed_themes = array( $stylesheet => true ); 844 844 if ( $template != $stylesheet ) 845 845 $allowed_themes[ $template ] = true; -
wp-admin/includes/class-wp-themes-list-table.php
41 41 } 42 42 } 43 43 44 unset( $themes[ get_ option( 'stylesheet') ] );44 unset( $themes[ get_stylesheet() ] ); 45 45 WP_Theme::sort_by_name( $themes ); 46 46 47 47 $per_page = 999; … … 126 126 $title = $theme->display('Name'); 127 127 $version = $theme->display('Version'); 128 128 $author = $theme->display('Author'); 129 129 130 130 $activate_link = wp_nonce_url( "themes.php?action=activate&template=" . urlencode( $template ) . "&stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $template ); 131 131 $preview_link = esc_url( add_query_arg( 132 132 array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ), 133 133 home_url( '/' ) ) ); 134 134 135 135 $actions = array(); 136 136 $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' 137 137 . esc_attr( sprintf( __( 'Activate “%s”' ), $title ) ) . '">' . __( 'Activate' ) . '</a>'; … … 141 141 $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&template=$stylesheet", 'delete-theme_' . $stylesheet ) 142 142 . '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $title ) ) 143 143 . "' );" . '">' . __( 'Delete' ) . '</a>'; 144 144 145 145 $actions = apply_filters( 'theme_action_links', $actions, $theme ); 146 146 147 147 $actions = implode ( ' | ', $actions ); 148 148 ?> 149 149 <a href="<?php echo $preview_link; ?>" class="thickbox thickbox-preview screenshot"> … … 154 154 <h3><?php 155 155 /* translators: 1: theme title, 2: theme version, 3: theme author */ 156 156 printf( __( '%1$s %2$s by %3$s' ), $title, $version, $author ) ; ?></h3> 157 157 158 158 <span class='action-links'><?php echo $actions ?></span> 159 159 <span class="separator hide-if-no-js">| </span><a href="#" class="theme-detail hide-if-no-js" tabindex='4'><?php _e('Details') ?></a> 160 160 <div class="themedetaildiv hide-if-js"> -
wp-admin/includes/template.php
1485 1485 1486 1486 function _media_states( $post ) { 1487 1487 $media_states = array(); 1488 $stylesheet = get_ option('stylesheet');1488 $stylesheet = get_stylesheet(); 1489 1489 1490 1490 if ( current_theme_supports( 'custom-header') ) { 1491 1491 $meta_header = get_post_meta($post->ID, '_wp_attachment_is_custom_header', true ); -
wp-admin/theme-editor.php
241 241 <?php } ?> 242 242 243 243 <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() ) : ?> 245 245 <p><?php if ( is_writeable( $file ) ) { ?><strong><?php _e( 'Caution:' ); ?></strong><?php } ?> 246 246 <?php _e( 'This is a file in your current parent theme.' ); ?></p> 247 247 <?php endif; ?> -
wp-admin/network/themes.php
110 110 111 111 $themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array(); 112 112 113 unset( $themes[ get_ option( 'stylesheet' ) ], $themes[ get_option( 'template') ] );113 unset( $themes[ get_stylesheet() ], $themes[ get_template() ] ); 114 114 115 115 if ( empty( $themes ) ) { 116 116 wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );