Skip to content

Instantly share code, notes, and snippets.

@thomasgriffin
Created March 5, 2012 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasgriffin/1980990 to your computer and use it in GitHub Desktop.
Save thomasgriffin/1980990 to your computer and use it in GitHub Desktop.
<?php
add_action( 'wp_ajax_myajax-submit', 'tgm_process_ajax' );
add_action( 'wp_ajax_nopriv_myajax-submit', 'tgm_process_ajax' );
function tgm_process_ajax() {
$data = array(
'quantity' => $_POST['wl_quantity'],
'post_id' => $_POST['wl_post_id']
);
echo json_encode( $data );
die;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment