title: Duplicate email validation using jquery validate in wordpress
body: <p>I am trying to validate duplicate email using jquery Validate plugin in wordpress.But for some reason the function returns 0 always.</p>
  
  <p>jQuery code:</p>
  
  <pre><code> email: {
             required: true,
             email: true,
             "remote":
                     {
                        url: CartAjax.ajaxurl,
                        type: "post",
                        data:
                            {
                              email: function()
                              {
                               return $('#frmorder :input[name="email"]').val();
                              },
                               action: 'duplicate_email_check'
                            }
                          }
           },
  </code></pre>
  
  <p>In my theme functions.php</p>
  
  <pre><code>add_action('admin_post_duplicate_email_check', 'duplicate_email_check');
  add_action('admin_post_nopriv_duplicate_email_check', 'duplicate_email_check');
  
  function duplicate_email_check()
  {
      echo "true";
  die();
  }
  </code></pre>
  
  <p>If true it should return 1 instead 0 but it's returning 0 always.</p>
  
  <p>Any help is highly appreciated.</p>