Conditional Functions

Migration to module
This commit is contained in:
savvasha
2018-02-27 21:35:31 +02:00
parent 9db32d4d3d
commit f447694a59
2 changed files with 7 additions and 1 deletions

View File

@@ -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.