The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Displaying Payment & Subscription Info in a View
add_shortcode('frm_payment_status', 'frm_payment_status')
function frm_payment_status($atts){
extract(shortcode_atts(array('id' => false, 'field' => ''), $atts));
if(!$id) return ''; //if no entry id is specified, then don't return anything
global $wpdb;
$completed = $wpdb->get_var($wpdb->prepare("SELECT $field FROM {$wpdb->prefix}frm_payments WHERE item_id=%d", (int) $id));
if ( $field != 'status' ){
return $completed;
} else {
return $completed ? 'Complete' : 'Not complete'; //change your text here
}
}
add_shortcode('frm_subscription_status', 'frm_subscription_status');
function frm_subscription_status($atts){
extract(shortcode_atts(array('id' => false, 'field' => ''), $atts));
if(!$id) return ''; //if no entry id is specified, then don't return anything
global $wpdb;
$result = $wpdb->get_var($wpdb->prepare("SELECT $field FROM {$wpdb->prefix}frm_subscriptions WHERE item_id=%d", (int) $id));
return $result;
}
Discussion closed.