Changeset 34728
- Timestamp:
- 10/01/2015 02:09:41 AM (9 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-list-table.php
r34707 r34728 1008 1008 1009 1009 /** 1010 * If 'orderby' is set, return it. 1011 * 1012 * @access protected 1013 * @since 4.4.0 1014 * 1015 * @return string The value of 'orderby' or empty string. 1016 */ 1017 protected function get_orderby() { 1018 if ( isset( $_GET['orderby'] ) ) { 1019 return $_GET['orderby']; 1020 } 1021 1022 return ''; 1023 } 1024 1025 /** 1026 * If 'order' is 'desc', return it. Else return 'asc'. 1027 * 1028 * @access protected 1029 * @since 4.4.0 1030 * 1031 * @return string 'desc' or 'asc'. 1032 */ 1033 protected function get_order() { 1034 if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) { 1035 return 'desc'; 1036 } 1037 1038 return 'asc'; 1039 } 1040 1041 /** 1010 1042 * Print column headers, accounting for hidden and sortable columns. 1011 1043 * … … 1023 1055 $current_url = remove_query_arg( 'paged', $current_url ); 1024 1056 1025 if ( isset( $_GET['orderby'] ) ) 1026 $current_orderby = $_GET['orderby']; 1027 else 1028 $current_orderby = ''; 1029 1030 if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) 1031 $current_order = 'desc'; 1032 else 1033 $current_order = 'asc'; 1057 $current_orderby = $this->get_orderby(); 1058 $current_order = $this->get_order(); 1034 1059 1035 1060 if ( ! empty( $columns['cb'] ) ) { -
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r34667 r34728 122 122 123 123 /** 124 * Get the value of the 'orderby' query var. 125 * 126 * @access protected 127 * @since 4.4.0 128 * 129 * @return string The value of 'orderby'. 130 */ 131 protected function get_orderby() { 132 return strtolower( get_query_var( 'orderby' ) ); 133 } 134 135 /** 136 * Get the value of the 'order' query var. 137 * 138 * @access protected 139 * @since 4.4.0 140 * 141 * @return string The value of 'order'. 142 */ 143 protected function get_order() { 144 return strtolower( get_query_var( 'order' ) ); 145 } 146 147 /** 124 148 * 125 149 * @global array $avail_post_stati … … 131 155 global $avail_post_stati, $wp_query, $per_page, $mode; 132 156 157 // is going to call wp() 133 158 $avail_post_stati = wp_edit_posts_query(); 134 159 -
trunk/src/wp-admin/includes/post.php
r34690 r34728 1005 1005 } 1006 1006 1007 if ( isset( $q['orderby']) )1007 if ( isset( $q['orderby'] ) ) { 1008 1008 $orderby = $q['orderby']; 1009 elseif ( isset($q['post_status']) && in_array($q['post_status'], array('pending', 'draft')) )1009 } elseif ( isset( $q['post_status'] ) && in_array( $q['post_status'], array( 'pending', 'draft' ) ) ) { 1010 1010 $orderby = 'modified'; 1011 1012 if ( isset($q['order']) ) 1011 } else { 1012 $orderby = 'date'; 1013 } 1014 1015 if ( isset( $q['order'] ) ) { 1013 1016 $order = $q['order']; 1014 elseif ( isset($q['post_status']) && 'pending' == $q['post_status'] )1017 } elseif ( isset( $q['post_status'] ) && 'pending' == $q['post_status'] ) { 1015 1018 $order = 'ASC'; 1019 } else { 1020 $order = 'desc'; 1021 } 1016 1022 1017 1023 $per_page = "edit_{$post_type}_per_page";
Note: See TracChangeset
for help on using the changeset viewer.