Fix bugs, use plural post slugs, move actions and filters into hooks folder

This commit is contained in:
Brian Miyaji
2014-01-09 02:37:13 +11:00
parent e76d392726
commit bfcf6e9b38
32 changed files with 390 additions and 312 deletions

View File

@@ -0,0 +1,15 @@
<?php
function sportspress_pre_get_posts( $wp_query ) {
if ( is_admin() ):
$post_type = $wp_query->query['post_type'];
if ( in_array( $post_type, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic' ) ) ):
$wp_query->set( 'orderby', 'menu_order' );
$wp_query->set( 'order', 'ASC' );
elseif ( $post_type == 'sp_event' ):
$wp_query->set( 'orderby', 'post_date' );
$wp_query->set( 'order', 'ASC' );
endif;
endif;
}
add_filter('pre_get_posts', 'sportspress_pre_get_posts');