Last active
August 8, 2017 19:59
-
-
Save robertuniqid/684a47eee190ad203c64258d7ef75e97 to your computer and use it in GitHub Desktop.
Formidable WPEP Verification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user_entries = FrmEntry::getAll( [ | |
'form_id' => $required_form_id_any, | |
'user_id' => get_current_user_id(), | |
'parent_item_id' => 0 | |
] ); | |
if( empty( $user_entries ) ) | |
return false; | |
foreach( $user_entries as $user_entry ) { | |
if( class_exists( "FrmPaymentEntry" ) ) { | |
if( FrmFormAction::form_has_action_type( $user_entry->form_id, 'paypal' ) | |
|| FrmFormAction::form_has_action_type( $user_entry->form_id, 'payment' ) ) { | |
$payment_status = FrmPaymentEntry::get_completed_payments( $user_entry['id'] ); | |
if( in_array( $payment_status, [ 'complete', 1 ] ) ) | |
return true; | |
continue; | |
} | |
} | |
return true; | |
} | |
return false;// no access |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment