A TEXT POST

Frontend AJAX in WordPress

While working on WPOID, I realized there are time where we use shortcodes in our plugin to display forms and we want to submit the form values using ajax. But since ajax functionality is by default only available for wordpress dashboard ie. the availability of ajaxurl (admin-ajax.php) only when someone is logged in makes it really difficult. So here is a piece of code which you can put in any file ex. ‘ajax.php’ and then put the file ‘ajax.php’ in your plugin’s directory and then use it as ajax url.