mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-10 18:37:58 +01:00
Add parent selection support for custom post_types to the Page Attributes metabox. See #12643
git-svn-id: http://svn.automattic.com/wordpress/trunk@13778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e2736b7583
commit
5d965f2c1c
@ -512,12 +512,15 @@ function post_revisions_meta_box($post) {
|
||||
* @param object $post
|
||||
*/
|
||||
function page_attributes_meta_box($post) {
|
||||
$post_type_object = get_post_type_object($post->post_type);
|
||||
if ( $post_type_object->hierarchical ) {
|
||||
?>
|
||||
<h5><?php _e('Parent') ?></h5>
|
||||
<label class="screen-reader-text" for="parent_id"><?php _e('Page Parent') ?></label>
|
||||
<?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')); ?>
|
||||
<?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')); ?>
|
||||
<p><?php _e('You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
|
||||
<?php
|
||||
} // end hierarchical check.
|
||||
if ( 0 != count( get_page_templates() ) ) {
|
||||
$template = !empty($post->page_template) ? $post->page_template : false;
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user