Add importable post types function

This commit is contained in:
Brian Miyaji
2017-11-18 17:46:38 +11:00
parent 75dd3d2ce8
commit 32fd7ddfd7
2 changed files with 13 additions and 1 deletions

View File

@@ -102,7 +102,7 @@ class SP_Admin {
*/
public function action_links() {
global $pagenow, $typenow;
if ( in_array( $typenow, sp_primary_post_types() ) ) {
if ( in_array( $typenow, sp_importable_post_types() ) ) {
if ( 'sp_event' === $typenow ) {
if ( 'edit.php' === $pagenow ) {
?>

View File

@@ -58,6 +58,18 @@ if ( ! function_exists( 'sp_secondary_post_types' ) ) {
}
}
/**
* sp_importable_post_types - Returns array of SP post types with importers
*
* @access public
* @return array
*/
if ( ! function_exists( 'sp_importable_post_types' ) ) {
function sp_importable_post_types() {
return apply_filters( 'sportspress_importable_post_types', array( 'sp_event', 'sp_team', 'sp_player', 'sp_staff' ) );
}
}
/**
* sp_config_types - Returns array of SP config types
*