Skip to content

Instantly share code, notes, and snippets.

@hokuma
Created November 4, 2013 04:24
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 hokuma/7298059 to your computer and use it in GitHub Desktop.
Save hokuma/7298059 to your computer and use it in GitHub Desktop.
dashboardからajaxで何かを更新する ref: http://qiita.com/halhide/items/aa07a103f873ab34cf29
add_action( "wp_ajax_アクション名", "my_action_callback" );
function my_action_callback () {
/** アクションの中身 */
}
var data = {
action: "update_hoge", //wordpressに実行するアクションを指示するため
msg: "hello" //実際に送りたい内容
};
jQuery( ajaxurl, data, function( response ) {
/** 完了時にコールバック */
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment