diff --git a/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-meetup-status.php b/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-meetup-status.php index 5ccdc916a4..dbf039ecde 100644 --- a/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-meetup-status.php +++ b/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-meetup-status.php @@ -107,7 +107,7 @@ class Meetup_Status extends Base_Status { * @param string $status * @param array $options */ - public function __construct( $start_date, $end_date, $status = '', array $options = array() ) { + public function __construct( $start_date, $end_date, $status = 'any', array $options = array() ) { parent::__construct( $options ); @@ -119,7 +119,19 @@ public function __construct( $start_date, $end_date, $status = '', array $option $e->getMessage() ); } - $this->status = $status; + + if ( $status && 'any' !== $status ) { + $statuses = \Meetup_Admin::get_post_statuses(); + + if ( isset( $statuses[ $status ] ) ) { + $this->status = $status; + } else { + $this->error->add( + self::$slug . '-status-error', + 'Invalid status provided.' + ); + } + } } /** @@ -303,10 +315,6 @@ public static function render_public_page() { $year = $params['year']; $status = $params['status']; - if ( $status && ! isset( $statuses[ $status ] ) ) { - $status = null; - } - if ( ! empty( $params ) && isset( $params['range'] ) ) { $report = new self( $params['range']->start, $params['range']->end, $status, $params['options'] ); } diff --git a/public_html/wp-content/plugins/wordcamp-reports/views/html/meetup-status.php b/public_html/wp-content/plugins/wordcamp-reports/views/html/meetup-status.php index dd2bd2c1ee..57ffe5d45b 100644 --- a/public_html/wp-content/plugins/wordcamp-reports/views/html/meetup-status.php +++ b/public_html/wp-content/plugins/wordcamp-reports/views/html/meetup-status.php @@ -36,7 +36,7 @@ -
–
+–