Ticket #8592: 8592.2.patch
File 8592.2.patch, 4.5 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/class-wp-posts-list-table.php
847 847 <label> 848 848 <span class="title"><?php _e( 'Parent' ); ?></span> 849 849 <?php 850 $dropdown_args = array( 'post_type' => $post_type_object->name, 'selected' => $post->post_parent, 'name' => 'post_parent', 'show_option_none' => __( 'Main Page (no parent)' ), 'option_none_value' => 0, 'sort_column'=> 'menu_order, post_title' ); 850 if ( current_user_can( $post_type_object->cap->read_private_posts ) ) 851 $post_status = array( 'publish', 'private' ); 852 else 853 $post_status = 'publish'; 854 855 $dropdown_args = array( 856 'post_type' => $post_type_object->name, 857 'selected' => $post->post_parent, 858 'name' => 'post_parent', 859 'show_option_none' => __( 'Main Page (no parent)' ), 860 'option_none_value' => 0, 861 'sort_column' => 'menu_order, post_title', 862 'post_status' => $post_status 863 ); 864 851 865 if ( $bulk ) 852 866 $dropdown_args['show_option_no_change'] = __( '— No Change —' ); 853 867 $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args ); -
wp-admin/includes/meta-boxes.php
560 560 function page_attributes_meta_box($post) { 561 561 $post_type_object = get_post_type_object($post->post_type); 562 562 if ( $post_type_object->hierarchical ) { 563 $pages = wp_dropdown_pages(array('post_type' => $post->post_type, 'exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('(no parent)'), 'sort_column'=> 'menu_order, post_title', 'echo' => 0)); 563 if ( current_user_can( $post_type_object->cap->read_private_posts ) ) 564 $post_status = array( 'publish', 'private' ); 565 else 566 $post_status = 'publish'; 567 568 $dropdown_args = array( 569 'post_type' => $post->post_type, 570 'exclude_tree' => $post->ID, 571 'selected' => $post->post_parent, 572 'name' => 'parent_id', 573 'show_option_none' => __('(no parent)'), 574 'sort_column' => 'menu_order, post_title', 575 'echo' => 0, 576 'post_status' => $post_status 577 ); 578 579 $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args ); 580 $pages = wp_dropdown_pages( $dropdown_args ); 564 581 if ( ! empty($pages) ) { 565 582 ?> 566 583 <p><strong><?php _e('Parent') ?></strong></p> -
wp-includes/post-template.php
765 765 'selected' => 0, 'echo' => 1, 766 766 'name' => 'page_id', 'id' => '', 767 767 'show_option_none' => '', 'show_option_no_change' => '', 768 'option_none_value' => '' 768 'option_none_value' => '', 769 'post_status' => 'publish' 769 770 ); 770 771 771 772 $r = wp_parse_args( $args, $defaults ); … … 1099 1100 * @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element. 1100 1101 */ 1101 1102 function start_el(&$output, $page, $depth, $args) { 1103 $post_states = array(); 1102 1104 $pad = str_repeat(' ', $depth * 3); 1103 1105 1104 1106 $output .= "\t<option class=\"level-$depth\" value=\"$page->ID\""; 1105 1107 if ( $page->ID == $args['selected'] ) 1106 1108 $output .= ' selected="selected"'; 1107 1109 $output .= '>'; 1108 $title = apply_filters( 'list_pages', $page->post_title ); 1110 1111 $title = $page->post_title; 1112 1113 if ( !empty( $page->post_password ) ) 1114 $post_states['protected'] = __( 'Password protected' ); 1115 1116 if ( 'private' == $page->post_status ) 1117 $post_states['private'] = __( 'Private' ); 1118 1119 if ( 'draft' == $page->post_status ) 1120 $post_states['draft'] = __( 'Draft' ); 1121 1122 if ( 'pending' == $page->post_status ) 1123 // translators: post state 1124 $post_states['pending'] = _x( 'Pending', 'post state' ); 1125 1126 if ( is_sticky( $page->ID ) ) 1127 $post_states['sticky'] = __( 'Sticky' ); 1128 1129 $post_states = apply_filters( 'display_post_states', $post_states ); 1130 1131 if ( ! empty( $post_states ) ) { 1132 $states = implode( ', ', $post_states ); 1133 $title = $title . sprintf( ' (%s)', $states ); 1134 } 1135 1136 $title = apply_filters( 'list_pages', $title ); 1137 1109 1138 $output .= $pad . esc_html( $title ); 1110 1139 $output .= "</option>\n"; 1111 1140 }