Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample check of order records for a user
<?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
You can’t perform that action at this time.