Ticket #8592: 8592.patch
File 8592.patch, 5.2 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/class-wp-posts-list-table.php
844 844 <label> 845 845 <span class="title"><?php _e( 'Parent' ); ?></span> 846 846 <?php 847 $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' ); 847 if ( current_user_can( $post_type_object->cap->read_private_pages ) ) 848 $post_status = array( 'publish', 'private' ); 849 else 850 $post_status = 'publish'; 851 852 $dropdown_args = array( 853 'post_type' => $post_type_object->name, 854 'selected' => $post->post_parent, 855 'name' => 'post_parent', 856 'show_option_none' => __( 'Main Page (no parent)' ), 857 'option_none_value' => 0, 858 'sort_column' => 'menu_order, post_title', 859 'post_status' => $post_status 860 ); 861 848 862 if ( $bulk ) 849 863 $dropdown_args['show_option_no_change'] = __( '— No Change —' ); 850 864 $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args ); -
wp-admin/includes/meta-boxes.php
556 556 function page_attributes_meta_box($post) { 557 557 $post_type_object = get_post_type_object($post->post_type); 558 558 if ( $post_type_object->hierarchical ) { 559 $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)); 559 if ( current_user_can( $post_type_object->cap->read_private_posts ) ) 560 $post_status = array( 'publish', 'private' ); 561 else 562 $post_status = 'publish'; 563 564 $pages = wp_dropdown_pages( array( 565 'post_type' => $post->post_type, 566 'exclude_tree' => $post->ID, 567 'selected' => $post->post_parent, 568 'name' => 'parent_id', 569 'show_option_none' => __( '(no parent)' ), 570 'sort_column'=> 'menu_order, post_title', 571 'echo' => 0, 572 'post_status' => $post_status 573 ) ); 560 574 if ( ! empty($pages) ) { 561 575 ?> 562 576 <p><strong><?php _e('Parent') ?></strong></p> -
wp-includes/post-template.php
760 760 'selected' => 0, 'echo' => 1, 761 761 'name' => 'page_id', 'id' => '', 762 762 'show_option_none' => '', 'show_option_no_change' => '', 763 'option_none_value' => '' 763 'option_none_value' => '', 764 'post_status' => 'publish' 764 765 ); 765 766 766 767 $r = wp_parse_args( $args, $defaults ); … … 1094 1095 * @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element. 1095 1096 */ 1096 1097 function start_el(&$output, $page, $depth, $args) { 1098 $post_states = array(); 1097 1099 $pad = str_repeat(' ', $depth * 3); 1098 1100 1099 1101 $output .= "\t<option class=\"level-$depth\" value=\"$page->ID\""; 1100 1102 if ( $page->ID == $args['selected'] ) 1101 1103 $output .= ' selected="selected"'; 1102 1104 $output .= '>'; 1103 $title = apply_filters( 'list_pages', $page->post_title ); 1105 $title = $page->post_title; 1106 1107 if ( !empty( $page->post_password ) ) 1108 $post_states['protected'] = __( 'Password protected' ); 1109 1110 if ( 'private' == $page->post_status ) 1111 $post_states['private'] = __( 'Private' ); 1112 1113 if ( 'draft' == $page->post_status ) 1114 $post_states['draft'] = __( 'Draft' ); 1115 1116 if ( 'pending' == $page->post_status ) 1117 // translators: post state 1118 $post_states['pending'] = _x( 'Pending', 'post state' ); 1119 1120 if ( is_sticky( $page->ID ) ) 1121 $post_states['sticky'] = __( 'Sticky' ); 1122 1123 $post_states = apply_filters( 'display_post_states', $post_states ); 1124 1125 if ( ! empty( $post_states ) ) { 1126 $states = implode( ', ', $post_states ); 1127 $title = $title . sprintf( ' (%s)', $states ); 1128 } 1129 1130 $title = apply_filters( 'list_pages', $title ); 1131 $title = esc_html($title); 1104 1132 $output .= $pad . esc_html( $title ); 1105 1133 $output .= "</option>\n"; 1106 1134 } -
wp-includes/post.php
3322 3322 return false; 3323 3323 3324 3324 // Make sure we have a valid post status 3325 if ( !in_array($post_status, get_post_stati()) ) 3325 if ( !is_array( $post_status ) ) 3326 $post_status = explode( ',', $post_status ); 3327 if ( count( array_diff( $post_status, get_post_stati() ) ) ) 3326 3328 return false; 3327 3329 3328 3330 $cache = array(); … … 3417 3419 if ( $parent >= 0 ) 3418 3420 $where .= $wpdb->prepare(' AND post_parent = %d ', $parent); 3419 3421 3420 $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 3422 if ( 1 == count( $post_status ) ) { 3423 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $post_type, array_shift( $post_status ) ); 3424 } else { 3425 $post_status = implode( "', '", $post_status ); 3426 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $post_type ); 3427 } 3421 3428 3422 3429 $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; 3423 3430 $query .= $author_query;