Ticket #25493: 25493.2.patch
File 25493.2.patch, 2.5 KB (added by , 9 years ago) |
---|
-
src/wp-admin/includes/class-wp-list-table.php
1037 1037 } 1038 1038 1039 1039 /** 1040 * If 'orderby' is set, return it.1041 *1042 * @access protected1043 * @since 4.4.01044 *1045 * @return string The value of 'orderby' or empty string.1046 */1047 protected function get_orderby() {1048 if ( isset( $_GET['orderby'] ) ) {1049 return $_GET['orderby'];1050 }1051 1052 return '';1053 }1054 1055 /**1056 * If 'order' is 'desc', return it. Else return 'asc'.1057 *1058 * @access protected1059 * @since 4.4.01060 *1061 * @return string 'desc' or 'asc'.1062 */1063 protected function get_order() {1064 if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {1065 return 'desc';1066 }1067 1068 return 'asc';1069 }1070 1071 /**1072 1040 * Print column headers, accounting for hidden and sortable columns. 1073 1041 * 1074 1042 * @since 3.1.0 … … 1084 1052 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 1085 1053 $current_url = remove_query_arg( 'paged', $current_url ); 1086 1054 1087 $current_orderby = $this->get_orderby(); 1088 $current_order = $this->get_order(); 1055 if ( isset( $_GET['orderby'] ) ) { 1056 $current_orderby = $_GET['orderby']; 1057 } else { 1058 $current_orderby = ''; 1059 } 1089 1060 1061 if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) { 1062 $current_order = 'desc'; 1063 } else { 1064 $current_order = 'asc'; 1065 } 1066 1090 1067 if ( ! empty( $columns['cb'] ) ) { 1091 1068 static $cb_counter = 1; 1092 1069 $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>' -
src/wp-admin/includes/post.php
1008 1008 $orderby = $q['orderby']; 1009 1009 } elseif ( isset( $q['post_status'] ) && in_array( $q['post_status'], array( 'pending', 'draft' ) ) ) { 1010 1010 $orderby = 'modified'; 1011 } elseif ( ! is_post_type_hierarchical( $post_type ) ) {1012 $orderby = 'date';1013 1011 } 1014 1012 1015 1013 if ( isset( $q['order'] ) ) { 1016 1014 $order = $q['order']; 1017 1015 } elseif ( isset( $q['post_status'] ) && 'pending' == $q['post_status'] ) { 1018 1016 $order = 'ASC'; 1019 } else {1020 $order = 'desc';1021 1017 } 1022 1018 1023 1019 $per_page = "edit_{$post_type}_per_page"; … … 1844 1840 */ 1845 1841 wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) ); 1846 1842 exit; 1847 } 1848 No newline at end of file 1843 }