Skip to content

Instantly share code, notes, and snippets.

@garyc40
Created October 3, 2012 15:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garyc40/3827496 to your computer and use it in GitHub Desktop.
Save garyc40/3827496 to your computer and use it in GitHub Desktop.
WordPress AJAX hooks
// this hook is fired if the current viewer is not logged in
do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] );
// if logged in:
do_action( 'wp_ajax_' . $_POST['action'] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment