- Timestamp:
- 06/21/2023 09:45:52 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r55954 r55971 761 761 */ 762 762 protected function get_sortable_columns() { 763 return array( 764 'title' => 'title', 765 'parent' => 'parent', 766 'comments' => 'comment_count', 767 'date' => array( 'date', true ), 768 ); 763 764 $post_type = $this->screen->post_type; 765 766 if ( 'page' === $post_type ) { 767 $title_orderby_text = isset( $_GET['orderby'] ) ? __( 'Table ordered by Title.' ) : __( 'Table ordered by Hierarchical Menu Order and Title.' ); 768 $sortables = array( 769 'title' => array( 'title', false, __( 'Title' ), $title_orderby_text, 'asc' ), 770 'parent' => array( 'parent', false ), 771 'comments' => array( 'comment_count', false, __( 'Comments' ), __( 'Table ordered by Comments.' ) ), 772 'date' => array( 'date', true, __( 'Date' ), __( 'Table ordered by Date.' ) ), 773 ); 774 } else { 775 $sortables = array( 776 'title' => array( 'title', false, __( 'Title' ), __( 'Table ordered by Title.' ) ), 777 'parent' => array( 'parent', false ), 778 'comments' => array( 'comment_count', false, __( 'Comments' ), __( 'Table ordered by Comments.' ) ), 779 'date' => array( 'date', true, __( 'Date' ), __( 'Table ordered by Date.' ), 'desc' ), 780 ); 781 } 782 // Custom Post Types: there's a filter for that, see get_column_info(). 783 784 return $sortables; 769 785 } 770 786
Note: See TracChangeset
for help on using the changeset viewer.