Created
February 2, 2017 00:21
-
-
Save eighty20results/02239edf07f921eecf612c91e635e8d9 to your computer and use it in GitHub Desktop.
Sample check of order records for a user
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 | |
global $wpdb; | |
$records = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->pmpro_membership_orders} WHERE user_id = %d AND status = %s", $user_id, 'success' ) ); | |
if ( $records == 1 ) { | |
// No previous order found | |
} else { | |
// Found old orders so member is not new | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment