From f447694a59dfe3b0b531010487f64edfe3ce3970 Mon Sep 17 00:00:00 2001 From: savvasha Date: Tue, 27 Feb 2018 21:35:31 +0200 Subject: [PATCH] Conditional Functions Migration to module --- includes/sp-conditional-functions.php | 2 +- modules/sportspress-event-specs.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/sp-conditional-functions.php b/includes/sp-conditional-functions.php index ac475f54..8793c4c4 100755 --- a/includes/sp-conditional-functions.php +++ b/includes/sp-conditional-functions.php @@ -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' ) ); } } diff --git a/modules/sportspress-event-specs.php b/modules/sportspress-event-specs.php index 4a4bd338..66b18fec 100644 --- a/modules/sportspress-event-specs.php +++ b/modules/sportspress-event-specs.php @@ -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.