Advertisement
wclovers

Stop sending automatic email verification code

Jul 11th, 2023
849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. // Stop automatic sending email verification code
  2. add_action('wp_enqueue_scripts', function () {
  3.     if (is_wcfm_membership_page()) {
  4.         $current_step = wcfm_membership_registration_current_step();
  5.  
  6.         switch ($current_step) {
  7.             case 'registration':
  8.                 ob_start();
  9.                 ?>
  10.                 <script>
  11.                     (function($) {
  12.                         $('#user_email').off('blur');
  13.                     })(jQuery);
  14.                 </script>
  15.                 <?php
  16.                 $script = ob_get_clean();
  17.                 break;
  18.         }
  19.     }
  20.  
  21.     if (is_wcfm_registration_page()) {
  22.         ob_start();
  23.         ?>
  24.         <script>
  25.             jQuery(document).ready(function($) {
  26.                 $('#user_email').off('blur');
  27.             });
  28.         </script>
  29.         <?php
  30.         $script = ob_get_clean();
  31.     }
  32.  
  33.     wp_add_inline_script('wcfm_membership_registration_js', $script, 'after');
  34. }, 999);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement