Ticket #35416: patch_for_page_sort_parent.diff
File patch_for_page_sort_parent.diff, 2.6 KB (added by , 5 years ago) |
---|
-
src/wp-admin/includes/class-wp-posts-list-table.php
diff --git src/wp-admin/includes/class-wp-posts-list-table.php src/wp-admin/includes/class-wp-posts-list-table.php index 9be84ae2e5..b19f5de957 100644
class WP_Posts_List_Table extends WP_List_Table { 610 610 if ( post_type_supports( $post_type, 'author' ) ) { 611 611 $posts_columns['author'] = __( 'Author' ); 612 612 } 613 614 if ( is_post_type_hierarchical( $post_type ) ) { 615 $posts_columns['parent'] = __( 'Parent' ); 616 } 613 617 614 618 $taxonomies = get_object_taxonomies( $post_type, 'objects' ); 615 619 $taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' ); … … class WP_Posts_List_Table extends WP_List_Table { 1216 1220 return; 1217 1221 } 1218 1222 1223 if ( 'parent' === $column_name ) { 1224 $parent_id = $post->post_parent; 1225 if( $parent_id != 0 ){ 1226 $parent_post = get_post( $parent_id ); 1227 $url = esc_url($_SERVER['REQUEST_URI']); 1228 $url = add_query_arg( 'post_parent', $parent_id, $url ); 1229 $url = add_query_arg( 'orderby', 'parent', $url ); 1230 echo '<a href="' . $url . '">' . $parent_post->post_name . '</a>'; 1231 } 1232 } 1233 1219 1234 if ( is_post_type_hierarchical( $post->post_type ) ) { 1220 1235 1221 1236 /** -
src/wp-includes/class-wp.php
diff --git src/wp-includes/class-wp.php src/wp-includes/class-wp.php index ec9565266d..1958a346f7 100644
class WP { 14 14 * @since 2.0.0 15 15 * @var string[] 16 16 */ 17 public $public_query_vars = array( 'm', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'attachment', ' attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' );17 public $public_query_vars = array( 'm', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'attachment', 'post_parent', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' ); 18 18 19 19 /** 20 20 * Private query variables.