Fix permissions, add post filters
This commit is contained in:
13
admin/hooks/parse-query.php
Normal file
13
admin/hooks/parse-query.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
function sportspress_parse_query( $query ) {
|
||||
global $pagenow, $typenow;
|
||||
|
||||
if ( is_admin() && $pagenow == 'edit.php' ):
|
||||
|
||||
if( in_array( $typenow, array( 'sp_event', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) ) && isset( $_GET['team'] ) ):
|
||||
$query->query_vars['meta_key'] = 'sp_team';
|
||||
$query->query_vars['meta_value'] = $_GET['team'];
|
||||
endif;
|
||||
endif;
|
||||
}
|
||||
add_filter('parse_query', 'sportspress_parse_query');
|
||||
Reference in New Issue
Block a user