WordPress.org

Make WordPress Core

Changeset 13776


Ignore:
Timestamp:
03/20/2010 02:37:16 AM (12 years ago)
Author:
dd32
Message:

Fix notice in Page Templates when a Template is not set for the current page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/meta-boxes.php

    r13775 r13776  
    512512 * @param object $post
    513513 */
    514 function page_attributes_meta_box($post){
     514function page_attributes_meta_box($post) {
    515515?>
    516516<h5><?php _e('Parent') ?></h5>
     
    519519<p><?php _e('You can arrange your pages in hierarchies. For example, you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
    520520<?php
    521     if ( 0 != count( get_page_templates() ) ) { ?>
     521    if ( 0 != count( get_page_templates() ) ) {
     522        $template = !empty($post->page_template) ? $post->page_template : false;
     523        ?>
    522524<h5><?php _e('Template') ?></h5>
    523525<label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
    524526<option value='default'><?php _e('Default Template'); ?></option>
    525 <?php page_template_dropdown($post->page_template); ?>
     527<?php page_template_dropdown($template); ?>
    526528</select>
    527529<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them above.'); ?></p>
Note: See TracChangeset for help on using the changeset viewer.