Skip to content

Instantly share code, notes, and snippets.

View willyfc's full-sized avatar

Willans Flores Casivanis willyfc

View GitHub Profile
@agustinprosperi
agustinprosperi / wp_ajax_callback_example.php
Last active June 9, 2017 22:14
wordpress ajax callback example
<form id="search">
<input type="hidden" name="action" value="custom_search" />
<input type="text" id="texto" name="texto" />
<input type="submit" value="submit" />
</form>
<div id="answer"></div>
<script type="text/javascript">
jQuery(function($){
$("#search").submit(function(e){
if( $("#search").hasClass("sending") ) return false;
<form id="search">
<input type="hidden" name="action" value="custom_search" />
<input type="text" id="texto" name="texto" />
<input type="submit" value="submit" />
</form>
<div id="answer"></div>
<script type="text/javascript">
jQuery(function($){
$("#search").submit(function(e){
if( $("#search").hasClass("sending") ) return false;