MemberPress: Change the Text and URL of the Mailchimp Privacy Link in MemberPress
add_action( ‘wp_head’, function() { ?>Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_action( ‘wp_head’, function() { ?>Continue reading
function mepr_cust_no_vat_to_taxjar( $should_send, $event ) { $transaction = $event->get_data(); if ( strpos( $transaction->tax_desc, __( ‘VAT’, ‘memberpress’ ) ) !== false ) { $should_send = false; } return $should_send; } add_filter( ‘mepr_taxjar_should_send_txn’, ‘mepr_cust_no_vat_to_taxjar’, 10, 2 );Continue reading
function mepr_dequeue_wpforms_on_register_page() { global $post; $is_product_page = ( false !== ( $prd = \MeprProduct::is_product_page($post) ) ); $is_account_page = \MeprUser::is_account_page($post); if($is_product_page || $is_account_page) { wp_deregister_script( ‘wpforms-smart-phone-field’ ); wp_dequeue_script( ‘wpforms-smart-phone-field’ ); } } add_action( ‘wpforms_frontend_js’, ‘mepr_dequeue_wpforms_on_register_page’, 9999 );Continue reading
function mepr_custom_send_mailpoet_confirm($request_args) { $request_args[‘send_confirmation_email’] = true; return $request_args; } add_filter(‘mepr-mailpoet-subscribe-args’, ‘mepr_custom_send_mailpoet_confirm’);Continue reading
add_action(‘mepr-event-subscription-expired’, function($event) { $txn = $event->get_data(); // Get the transaction data from the event $user = $txn->user(); // Get the user associated with the transaction // Check if the expired subscription is for the specific membership if ($txn->product_id == ‘123’)…Continue reading
add_action(‘mepr-event-subscription-stopped’, function($event) { $subscription = $event->get_data(); if(123 != (int) $subscription->product_id) { return; } $user = $subscription->user(); $wp_user = get_user_by(‘id’, $user->ID); if(!$wp_user) { return; } // Remove role $wp_user->remove_role( ‘subscriber’ ); // Add role $wp_user->add_role( ‘editor’ ); });Continue reading
add_action(‘init’, function () { if (!is_admin()) return; // STOP if SKUs were already generated if (get_option(‘auto_sku_generated’) === ‘yes’) return; // ✅ Immediately mark it done to prevent infinite loops update_option(‘auto_sku_generated’, ‘yes’); // Fetch all published WooCommerce products $args = array(…Continue reading
/** * MemberPress Downloads – Add Thumbnail Support * * Enables featured image functionality for MP Downloads files. */ add_action( ‘init’, function() { add_post_type_support( ‘mpdl-file’, ‘thumbnail’ ); });Continue reading
function mepr_change_invoice_bill_to( $invoice, $txn ) { $user = $txn->user(); // Get company custom field. // Replace ‘mepr_company_name’ with the custom field slug. $company = get_user_meta( $user->ID, ‘mepr_company_name’, true ); // Return company name if not empty $name = ( !empty(…Continue reading
add_filter(‘comments_open’, function($open, $post_id) { $post = get_post($post_id); // Check if the post type is ‘mpcs-lesson’ or ‘mpcs-course’ if (in_array($post->post_type, [‘mpcs-lesson’, ‘mpcs-course’, ‘mpcs-quiz’, ‘mpcs-assignment’])) { $open = false; } return $open; }, 10, 2);Continue reading