WordPress.org

Make WordPress Core

Changeset 13778


Ignore:
Timestamp:
03/20/2010 02:46:31 AM (8 years ago)
Author:
dd32
Message:

Add parent selection support for custom post_types to the Page Attributes metabox. See #12643

File:
1 edited

Legend:

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

    r13777 r13778  
    513513 */
    514514function page_attributes_meta_box($post) {
     515    $post_type_object = get_post_type_object($post->post_type);
     516    if ( $post_type_object->hierarchical ) {
    515517?>
    516518<h5><?php _e('Parent') ?></h5>
    517519<label class="screen-reader-text" for="parent_id"><?php _e('Page Parent') ?></label>
    518 <?php wp_dropdown_pages(array('exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>
     520<?php wp_dropdown_pages(array('post_type' => $post->post_type, 'exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>
    519521<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>
    520522<?php
     523    } // end hierarchical check.
    521524    if ( 0 != count( get_page_templates() ) ) {
    522525        $template = !empty($post->page_template) ? $post->page_template : false;
Note: See TracChangeset for help on using the changeset viewer.