Move post type specific functions into classes

This commit is contained in:
Brian Miyaji
2014-04-26 17:52:43 +10:00
parent b6342b97e3
commit 284b0f1a5f
36 changed files with 2234 additions and 3062 deletions

View File

@@ -22,6 +22,24 @@ function is_sportspress() {
return apply_filters( 'is_sportspress', ( is_singular( array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) ) ) ? true : false );
}
/**
* is_sp_config_type - Returns true if post is SportsPress config type
*
* @access public
* @return bool
*/
if ( ! function_exists( 'is_sp_config_type' ) ) {
function is_sp_config_type( $typenow = null ) {
if ( $typenow == null ) global $typenow;
$post_types = array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric', 'sp_statistic' );
if ( in_array( $typenow, $post_types ) )
return true;
return false;
}
}
if ( ! function_exists( 'is_ajax' ) ) {
/**