Conditional Functions
Migration to module
This commit is contained in:
@@ -78,7 +78,7 @@ if ( ! function_exists( 'sp_importable_post_types' ) ) {
|
||||
*/
|
||||
if ( ! function_exists( 'sp_config_types' ) ) {
|
||||
function sp_config_types() {
|
||||
return apply_filters( 'sportspress_config_types', array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric', 'sp_spec', 'sp_statistic' ) );
|
||||
return apply_filters( 'sportspress_config_types', array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric', 'sp_statistic' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ class SportsPress_Event_Specs {
|
||||
// Filters
|
||||
add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) );
|
||||
add_filter( 'sportspress_screen_ids', array( $this, 'screen_ids' ) );
|
||||
add_filter( 'sportspress_config_types', array( $this, 'add_post_type' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,6 +99,11 @@ class SportsPress_Event_Specs {
|
||||
'sp_spec',
|
||||
) );
|
||||
}
|
||||
|
||||
public static function add_post_type( $post_types = array() ) {
|
||||
$post_types[] = 'sp_spec';
|
||||
return $post_types;
|
||||
}
|
||||
|
||||
/**
|
||||
* Conditonally load the class and functions only needed when viewing this post type.
|
||||
|
||||
Reference in New Issue
Block a user