ACF: Services

add_action(‘acf/init’, function() { if (!function_exists(‘acf_add_local_field_group’)) { return; } acf_add_local_field_group(array( ‘key’ => ‘group_services_catalog’, ‘title’ => ‘Services Catalog’, ‘fields’ => array( array( ‘key’ => ‘field_service_catalog’, ‘label’ => ‘Service Catalog’, ‘name’ => ‘service_catalog’, ‘type’ => ‘group’, ‘sub_fields’ => array( array( ‘key’ => ‘field_catalog_name’,…Continue reading

Add CTA Interstitial ACF Field Group

add_action( ‘acf/include_fields’, function() { if ( ! function_exists( ‘acf_add_local_field_group’ ) ) { return; } acf_add_local_field_group( array( ‘key’ => ‘group_67d0398f17a09’, ‘title’ => ‘CTA Interstitial’, ‘fields’ => array( array( ‘key’ => ‘field_67d0398f54df6’, ‘label’ => ‘Title’, ‘name’ => ‘cta_int_title’, ‘aria-label’ => ”, ‘type’…Continue reading

CTA Interstitial

// Add a page interstitial for a CTA section function cta_interstitial_shortcode() { $output = ”; $postid = get_the_ID(); $title = get_field(‘cta_int_title’, $postid); $copy = get_field(‘cta_int_copy’, $postid); $buttons = get_field(‘cta_int_buttons’, $postid); if (!empty($title && $copy) || have_rows(‘cta_int_buttons’)) { $output .= ‘…Continue reading

MemberPress: Filter Email Recipients Based on Expired Memberships

add_filter(‘mepr-wp-mail-recipients’, function($recipients, $subject, $message, $headers) { if (strpos($subject, ‘Subscription renewal’) !== false) { foreach ($recipients as $key => $recipient) { // Extract the email address from the recipient field $regExp = “/]+)>/”; preg_match($regExp, $recipient, $matches); $recipient = $matches[1]; $wp_user =…Continue reading

MemberPress: Add Email Parameter To Include the Password Reset Link

// Add “reset_password_link” email var function mepr_trans_email_var_password_link( $vars ) { $vars[] = ‘reset_password_link’; return $vars; } add_filter( ‘mepr_transaction_email_vars’, ‘mepr_trans_email_var_password_link’ ); // Add “reset_password_link” email parameter function mepr_trans_email_param_password_link( $params, $txn ) { $user = $txn->user(); $params[‘reset_password_link’] = $user->reset_password_link(); return $params; }…Continue reading

MemberPress: Enabling Payment Receipt Email for Free Recurring Subscriptions

function mepr_capture_recurring_sub( $event ) { // Get the transaction data from the event $txn = $event->get_data(); // Send the transaction receipt email MeprUtils::send_transaction_receipt_notices( $txn ); } // Attach the ‘mepr_capture_recurring_sub’ function to the ‘mepr-event-subscription-payment-completed’ event. add_action( ‘mepr-event-transaction-completed’, ‘mepr_capture_recurring_sub’ );Continue reading

MemberPress: Enabling Payment Receipt Email for Free Non-recurring Subscriptions

function mepr_capture_new_one_time_sub( $event ) { // Get the transaction data from the event $txn = $event->get_data(); // Send the transaction receipt email MeprUtils::send_transaction_receipt_notices( $txn ); } // Attach the ‘mepr_capture_new_one_time_sub’ function to the ‘mepr-event-non-recurring-transaction-completed’ event. add_action( ‘mepr-event-non-recurring-transaction-completed’, ‘mepr_capture_new_one_time_sub’ );Continue reading