Skip to content

Commit

Permalink
Add check to is_wordcamp_closed (#1419)
Browse files Browse the repository at this point in the history
When a `get_wordcamp_post()` cannot find a post, it return false, which then breaks the check against `post_status` - this stops that happening, and should also allow testing of tickets (when there is no post on central.wordcamp.org).
  • Loading branch information
pkevan authored Nov 5, 2024
1 parent 7e1d8d2 commit c2d8583
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions public_html/wp-content/plugins/camptix/camptix.php
Original file line number Diff line number Diff line change
Expand Up @@ -8601,6 +8601,10 @@ public function tmp( $key, $value = null ) {
*/
public function is_wordcamp_closed() {
$wordcamp = get_wordcamp_post();
// get_wordcamp_post() returns false if no post exists, so avoid breaking by returning here since it is not explicitly closed.
if ( false === $wordcamp ) {
return false;
}
return 'wcpt-closed' === $wordcamp->post_status;
}

Expand Down

0 comments on commit c2d8583

Please sign in to comment.