Home / Archive / MemberPress: WP Forms Pro – Fix Custom Phone Number Field
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: WP Forms Pro – Fix Custom Phone Number Field

When a custom phone number field is added to the MemberPress membership registration forms, WP Forms Pro will stop functioning (if installed). The following code snippet will fix the issue.

Code Preview
php
<?php
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 );

Comments

Add a Comment