Ticket #8592: 8592.4.diff
File 8592.4.diff, 4.0 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/class-wp-posts-list-table.php
845 845 <label> 846 846 <span class="title"><?php _e( 'Parent' ); ?></span> 847 847 <?php 848 $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' ); 848 if ( current_user_can( $post_type_object->cap->read_private_posts ) ) 849 $post_status = array( 'publish', 'private' ); 850 else 851 $post_status = 'publish'; 852 853 $dropdown_args = array( 854 'post_type' => $post_type_object->name, 855 'selected' => $post->post_parent, 856 'name' => 'post_parent', 857 'show_option_none' => __( 'Main Page (no parent)' ), 858 'option_none_value' => 0, 859 'sort_column'=> 'menu_order, post_title', 860 'post_status' => $post_status 861 ); 849 862 if ( $bulk ) 850 863 $dropdown_args['show_option_no_change'] = __( '— No Change —' ); 851 864 $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args ); -
wp-admin/includes/meta-boxes.php
557 557 function page_attributes_meta_box($post) { 558 558 $post_type_object = get_post_type_object($post->post_type); 559 559 if ( $post_type_object->hierarchical ) { 560 $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)); 560 if ( current_user_can( $post_type_object->cap->read_private_posts ) ) 561 $post_status = array( 'publish', 'private' ); 562 else 563 $post_status = 'publish'; 564 565 $pages = wp_dropdown_pages( array( 566 'post_type' => $post->post_type, 567 'exclude_tree' => $post->ID, 568 'selected' => $post->post_parent, 569 'name' => 'parent_id', 570 'show_option_none' => __( '(no parent)' ), 571 'sort_column'=> 'menu_order, post_title', 572 'echo' => 0, 573 'post_status' => $post_status 574 ) ); 561 575 if ( ! empty($pages) ) { 562 576 ?> 563 577 <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 ); -
wp-includes/post.php
3310 3310 return false; 3311 3311 3312 3312 // Make sure we have a valid post status 3313 if ( !in_array($post_status, get_post_stati()) ) 3313 if ( !is_array( $post_status ) ) 3314 $post_status = explode( ',', $post_status ); 3315 if ( count( array_diff( $post_status, get_post_stati() ) ) ) 3314 3316 return false; 3315 3317 3316 3318 $cache = array(); … … 3405 3407 if ( $parent >= 0 ) 3406 3408 $where .= $wpdb->prepare(' AND post_parent = %d ', $parent); 3407 3409 3408 $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 3410 if ( 1 == count( $post_status ) ) { 3411 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $post_type, array_shift( $post_status ) ); 3412 } else { 3413 $post_status = implode( "', '", $post_status ); 3414 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $post_type ); 3415 } 3409 3416 3410 3417 $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; 3411 3418 $query .= $author_query;