Enable admin post list sorting

This commit is contained in:
Brian Miyaji
2014-03-14 12:37:31 +11:00
parent 77624cc73f
commit aeda2a69c7

View File

@@ -2,6 +2,9 @@
function sportspress_pre_get_posts( $query ) { function sportspress_pre_get_posts( $query ) {
if ( is_admin() ): if ( is_admin() ):
if ( isset( $query->query[ 'orderby' ] ) || isset( $query->query[ 'order' ] ) ):
return $query;
endif;
$post_type = $query->query['post_type']; $post_type = $query->query['post_type'];
if ( in_array( $post_type, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic' ) ) ): if ( in_array( $post_type, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic' ) ) ):