Skip to content

Commit a685458

Browse files
committed
Ensure conversion to Supporter only with correct form
1 parent ea88d98 commit a685458

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

themes/osi/functions.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,12 @@ function osi_handle_supporter_form_flamingo_spam_status_change( string $new_stat
488488
}
489489

490490
if ( 'flamingo-spam' === $old_status && 'publish' === $new_status ) {
491+
$term_obj_list = get_the_terms( $post->ID, 'flamingo_inbound_channel' );
492+
493+
if ( empty( $term_obj_list ) || is_wp_error( $term_obj_list ) || 'OSAID Endorsement' !== $term_obj_list[0]->name ) {
494+
return;
495+
}
496+
491497
$form_data = array(
492498
'your-name' => get_post_meta( $post->ID, '_field_your-name', true ),
493499
'your-org' => get_post_meta( $post->ID, '_field_your-org', true ),

0 commit comments

Comments
 (0)