// Put in functions.php function imnobby_ajax_get_data(){ // Endpoint: /wp-admin/admin-ajax.php?action=imnobby_ajax_get_data $tmphtml = 'produce some output here'; echo $tmphtml; // Exit is required. exit(); } add_action('wp_ajax_imnobby_ajax_get_data', 'imnobby_ajax_get_data'); // For Logged-in Users add_action('wp_ajax_nopriv_imnobby_ajax_get_data', 'imnobby_ajax_get_data' ); // For Unauthenticated UsersRelated Keywords: Developer, How-to, Solved, WordPress admin-ajax.php, Sample Script Template, functions.php
喜歡這篇文章嗎?
(暫時未有評分)
Loading...
(暫時未有評分)
Loading...