Skip to content

Commit

Permalink
Add check to is_wordcamp_closed
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 Oct 29, 2024
1 parent 2bbc491 commit d948990
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 @@ -8584,6 +8584,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 d948990

Please sign in to comment.