Skip to content

Instantly share code, notes, and snippets.

@huuyafwww
Created November 24, 2017 06:09
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 huuyafwww/e66b0e423832b73ba9930c326fe62dd3 to your computer and use it in GitHub Desktop.
Save huuyafwww/e66b0e423832b73ba9930c326fe62dd3 to your computer and use it in GitHub Desktop.
function text_ajax_test(){
check_ajax_referer('text_test_ajax','secure');
if(isset($_REQUEST['text_test'])){
//ここに処理を書く
}
}
add_action('wp_ajax_text_ajax_test','text_ajax_test');//ログインユーザーがactionする場合
add_action('wp_ajax_nopriv_text_ajax_test','text_ajax_test');//非ログインユーザーがactionする場合
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment