Skip to content

Instantly share code, notes, and snippets.

@KristaButler
Created April 20, 2022 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KristaButler/23ceff41e87f03f7637631558c0e13b5 to your computer and use it in GitHub Desktop.
Save KristaButler/23ceff41e87f03f7637631558c0e13b5 to your computer and use it in GitHub Desktop.
MemberPress WP Forms Phone Number Field Fix
<?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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment