WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/17/2012 09:43:47 PM (8 years ago)
Author:
nacin
Message:

Move to admin.php?customize=on&theme=$stylesheet, rather than juggling both template and stylesheet values. see #19910.

Combine the setup_theme() and customize_previewing() methods. Remove the set_template() and set_stylesheet() methods. Add set_theme() method to WP_Customize to store the working WP_Theme object. We will use this for the stylesheet and template.

Use the WP_Theme display() method when preparing headers for display, not get() or the deprecate properties.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/customize-controls.php

    r20495 r20496  
    2828do_action( 'customize_controls_enqueue_scripts' );
    2929
    30 $theme = wp_get_theme();
    31 $screenshot = $theme->get_screenshot();
    32 
    3330// Let's roll.
    3431@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
     
    3734_wp_admin_html_begin();
    3835
    39 $admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $theme['Name'] ) ) );
     36$admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $this->theme->display('Name') ) ) );
    4037?><title><?php echo $admin_title; ?></title><?php
    4138
     
    4845        <?php wp_nonce_field( 'customize_controls' ); ?>
    4946        <input type="hidden" name="customize" value="on" />
    50         <input type="hidden" id="customize-template" name="template" value="<?php echo esc_attr( $theme['Template'] ); ?>" />
    51         <input type="hidden" id="customize-stylesheet" name="stylesheet" value="<?php echo esc_attr( $theme['Stylesheet'] ); ?>" />
    52 
     47        <input type="hidden" name="theme" value="<?php echo esc_attr( $this->get_stylesheet() ); ?>" />
    5348        <div id="customize-header-actions" class="customize-section wp-full-overlay-header">
    5449            <a class="back" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>">
     
    6055            <div class="customize-section-title">
    6156                <span class="preview-notice"><?php _e('You are previewing'); ?></span>
    62                 <strong class="theme-name"><?php echo $theme['Name']; ?></strong>
     57                <strong class="theme-name"><?php echo $this->theme->display('Name'); ?></strong>
    6358            </div>
    6459            <div class="customize-section-content">
    65                 <?php if ( $screenshot ) : ?>
     60                <?php if ( $screenshot = $this->theme->get_screenshot() ) : ?>
    6661                    <img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
    6762                <?php endif; ?>
    6863
    69                 <?php if ( $theme->description ): ?>
    70                     <div class="theme-description"><?php echo $theme->description; ?></div>
     64                <?php if ( $this->theme->get('Description') ): ?>
     65                    <div class="theme-description"><?php echo $this->theme->display('Description'); ?></div>
    7166                <?php endif; ?>
    7267            </div>
Note: See TracChangeset for help on using the changeset viewer.