Last active
August 11, 2016 01:10
-
-
Save sammyaxe/9119c2736e915b86c966223cad6ebd34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFunction(){ | |
echo 'My Ajax Response'; | |
exit; //must include exit othervise it will print out 0 | |
} | |
add_action('wp_ajax_my_action', 'myFunction'); // for logged in user | |
add_action('wp_ajax_nopriv_my_action', 'myFunction'); // if user not logged in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment