Skip to content

Instantly share code, notes, and snippets.

@bhavik-kiri
Last active June 21, 2017 11:28
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 bhavik-kiri/1c70580754e3c5548ecf3952c92c3198 to your computer and use it in GitHub Desktop.
Save bhavik-kiri/1c70580754e3c5548ecf3952c92c3198 to your computer and use it in GitHub Desktop.
It will add the ajax action
<?php
function load_ajax() {
if ( !is_user_logged_in() ){
add_action( 'wp_ajax_nopriv_update_order_review', 'update_order_review' );
} else{
add_action( 'wp_ajax_update_order_review', 'update_order_review' );
}
}
add_action( 'init', 'load_ajax' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment