Skip to content

Commit

Permalink
Check for Humanities_Commons class when checking for UP membership to…
Browse files Browse the repository at this point in the history
… avoid hard crash
  • Loading branch information
mikethicke committed Dec 19, 2024
1 parent 59a327f commit edec2f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions themes/aupresses-jobs/wp-job-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ function hc_custom_wp_jobs_can_post_job_up( $can_post ) {
if ( ! $can_post || strpos( $current_site, 'jobs.up.hcommons' ) === False ) {
return $can_post;
}
if ( ! class_exists( 'Humanities_Commons' ) ) {
return false;
}

$memberships = Humanities_Commons::hcommons_get_user_memberships();
if ( is_array($memberships['societies'] ) && in_array( 'up', $memberships['societies'] ) ) {
Expand Down

0 comments on commit edec2f5

Please sign in to comment.