Advertisement
wclovers

Untitled

Aug 29th, 2023
919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  1. add_action('wp_enqueue_scripts', function () {
  2.     $script = '';
  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.                     jQuery(document).ready(function($) {
  12.                         if( $('.wcfm_email_verified_input').length > 0 ) {
  13.                             $('#user_email').off('blur');
  14.                         }
  15.                     });
  16.                 </script>
  17.                 <?php
  18.                 $script = ob_get_clean();
  19.                 break;
  20.         }
  21.     }
  22.  
  23.     if (is_wcfm_registration_page()) {
  24.         ob_start();
  25.         ?>
  26.         <script>
  27.             jQuery(document).ready(function($) {
  28.                 if( $('.wcfm_email_verified_input').length > 0 ) {
  29.                     $('#user_email').off('blur');
  30.                 }
  31.             });
  32.         </script>
  33.         <?php
  34.         $script = ob_get_clean();
  35.     }
  36.  
  37.     wp_add_inline_script('wcfm_membership_registration_js', $script, 'after');
  38. }, 11);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement