Get event statuses on init

This commit is contained in:
Brian Miyaji
2016-09-09 21:49:13 +10:00
parent 845a1eb8d6
commit 1b633c8a84

View File

@@ -33,9 +33,7 @@ class SportsPress_Event_Status {
// Define constants // Define constants
$this->define_constants(); $this->define_constants();
// Define statuses add_action( 'init', array( $this, 'get_statuses' ) );
$this->get_statuses();
add_action( 'post_submitbox_misc_actions', array( $this, 'section' ) ); add_action( 'post_submitbox_misc_actions', array( $this, 'section' ) );
add_action( 'sportspress_process_sp_event_meta', array( $this, 'save' ), 10, 1 ); add_action( 'sportspress_process_sp_event_meta', array( $this, 'save' ), 10, 1 );
} }
@@ -57,7 +55,7 @@ class SportsPress_Event_Status {
/** /**
* Define statuses. * Define statuses.
*/ */
private function get_statuses() { public function get_statuses() {
$this->statuses = apply_filters( 'sportspress_event_statuses', array( $this->statuses = apply_filters( 'sportspress_event_statuses', array(
'ok' => __( 'On time', 'sportspress' ), 'ok' => __( 'On time', 'sportspress' ),
'tbd' => __( 'To be determined', 'sportspress' ) . ' (' . __( 'TBD', 'sportspress' ) . ')', 'tbd' => __( 'To be determined', 'sportspress' ) . ' (' . __( 'TBD', 'sportspress' ) . ')',