Created
November 4, 2013 04:24
-
-
Save hokuma/7298059 to your computer and use it in GitHub Desktop.
dashboardからajaxで何かを更新する ref: http://qiita.com/halhide/items/aa07a103f873ab34cf29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( "wp_ajax_アクション名", "my_action_callback" ); | |
function my_action_callback () { | |
/** アクションの中身 */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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