title: Calling PHP function from wordpress in ajax?
body: <p><strong>reset.php file:</strong></p>
  
  <pre><code> &lt;?php 
      add_action('admin_init','popup_template_reset_options');
  
      function popup_template_reset_options() 
          {
          delete_option('popup_template_on');
          delete_option('popup_template_close');
          delete_option('popup_template_escape');
          delete_option('popup_template_external');
          delete_option('popup_template_home_page');
          delete_option('popup_template_all_pages');
          delete_option('popup_template_template');
          delete_option('popup_cookies_display_after_like');
          add_option('popup_cookies_display_after_like','365');
          //add_option('popup_template_on','1');
          add_option('popup_template_close','1');
          add_option('popup_template_escape','1');
          add_option('popup_template_external','1');
          add_option('popup_template_force_timer','2');
          add_option('popup_template_home_page','1');
          add_option('popup_template_all_pages','1');
          add_option('popup_template_template','2');
  
      }
      ?&gt;
  </code></pre>
  
  <p><strong>Script Ajax:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $('#reset_general').click(function()
          {
              $('#result1').css("display", "block");
              jQuery('#result1').animate({'opacity': '1'});
  
          });
      });
      function resetgeneral() {
          $.ajax({type: 'POST', url: '&lt;?php echo WP_PLUGIN_URL; ?&gt;/fantasticpopuptemplate/inc/reset.php', success: function(response) {
  
                  //$('#fff').find('.form_result').html(response);
                  $('#result1').css("display", "none");
                  $('#resets1').css("display", "block");
                  $('#resets1').html("Settings Resets");
                  $('#resets1').fadeOut(2500, "linear");
              }});
  
          return false;
      }
  
  &lt;/script&gt;
  &lt;form onsubmit="return resetgeneral();" id="form_general_reset" class="form-1"&gt;
      &lt;input type="submit" value="Reset" id="reset_general" name="reset" class="button-secondary"/&gt;
      &lt;input name="action" type="hidden" value="reset" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>Hi i trying to call the php reset function in ajax but when i googling i know that not possibilities of direct calling php function so I put that particular function in seperate php file and call that php file i am not sure how can i do this in ajax i tried this above code but nothing happen. Settings Resets Message appear. How Can I do this Any Help would be great. Before using the ajax concept i tried with <code>isset</code> function in php But it getting page load every time for that only i jump into the ajax.</p>