Use wp_dropdown_page()

git-svn-id: http://svn.automattic.com/wordpress/trunk@10069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-12-05 18:03:24 +00:00
parent 34f737b984
commit b13f38f6e3
2 changed files with 11 additions and 9 deletions

View File

@ -1046,13 +1046,12 @@ function inline_edit_row( $type ) {
<label>
<span class="title"><?php _e( 'Parent' ); ?></span>
<select name="post_parent">
<?php if ( $bulk ) : ?>
<option value="-1"><?php _e('- No Change -'); ?></option>
<?php endif; // $bulk ?>
<option value="0"><?php _e( 'Main Page (no parent)' ); ?></option>
<?php parent_dropdown(); ?>
</select>
<?php
$dropdown_args = array('selected' => $post->post_parent, 'name' => 'post_parent', 'show_option_none' => __('Main Page (no parent)'), 'option_none_value' => 0);
if ( $bulk )
$dropdown_args['show_option_no_change'] = __('- No Change -');
?>
<?php wp_dropdown_pages($dropdown_args); ?>
</label>
<?php if ( !$bulk ) : ?>

View File

@ -554,7 +554,8 @@ function wp_dropdown_pages($args = '') {
$defaults = array(
'depth' => 0, 'child_of' => 0,
'selected' => 0, 'echo' => 1,
'name' => 'page_id', 'show_option_none' => ''
'name' => 'page_id', 'show_option_none' => '', 'show_option_no_change' => '',
'option_none_value' => ''
);
$r = wp_parse_args( $args, $defaults );
@ -565,8 +566,10 @@ function wp_dropdown_pages($args = '') {
if ( ! empty($pages) ) {
$output = "<select name='$name' id='$name'>\n";
if ( $show_option_no_change )
$output .= "\t<option value='-1'>$show_option_no_change</option>";
if ( $show_option_none )
$output .= "\t<option value=''>$show_option_none</option>\n";
$output .= "\t<option value='$option_none_value'>$show_option_none</option>\n";
$output .= walk_page_dropdown_tree($pages, $depth, $r);
$output .= "</select>\n";
}