Sort competitions, seasons, venues, positions, and jobs by slug

This commit is contained in:
Brian Miyaji
2016-04-13 17:07:38 +10:00
parent c808012201
commit 07235517e1
2 changed files with 33 additions and 1 deletions

View File

@@ -78,7 +78,7 @@ if ( ! function_exists( 'sp_config_types' ) ) {
*/
if ( ! function_exists( 'sp_taxonomies' ) ) {
function sp_taxonomies() {
return apply_filters( 'sportspress_taxonomies', array( 'sp_league', 'sp_season', 'sp_venue', 'sp_position' ) );
return apply_filters( 'sportspress_taxonomies', array( 'sp_league', 'sp_season', 'sp_venue', 'sp_position', 'sp_role' ) );
}
}
@@ -138,6 +138,24 @@ if ( ! function_exists( 'is_sp_config_type' ) ) {
}
}
/**
* is_sp_taxonomy - Returns true if post is SportsPress taxonomy
*
* @access public
* @return bool
*/
if ( ! function_exists( 'is_sp_taxonomy' ) ) {
function is_sp_taxonomy( $typenow = null ) {
if ( $typenow == null ) global $typenow;
$taxonomies = sp_taxonomies();
if ( in_array( $typenow, $taxonomies ) )
return true;
return false;
}
}
if ( ! function_exists( 'is_ajax' ) ) {
/**