åºæ¬ã®è§£èª¬ STEP1. ãªã¯ã¨ã¹ãéä¿¡å ã®ãã¹ WordPress 㧠Ajax ã使ãå ´å /wp-admin/admin-ajax.php ã«ãªã¯ã¨ã¹ããéããã¨ã«æ±ºã¾ã£ã¦ããã JavaScript ãã¡ã¤ã«å ã§åçã«ãã¹ãæå®ãããã¨ã¯ã§ããªãã®ã§ãwp_head ã«ããã¯ãã¦ãªã¯ã¨ã¹ãéä¿¡å ã®URLãã°ãã¼ãã«å¤æ°ã¨ãã¦åºåãã¦ããã > functions.php function add_my_ajaxurl() { ?> <script> var ajaxurl = '<?php echo admin_url( 'admin-ajax.php'); ?>'; </script> <?php } add_action( 'wp_head', 'add_my_ajaxurl', 1 ); wp_head ã¢ã¯ã·ã§ã³ã«ããã¯ãããã¨ã§ head è¦ç´ å ã« JavaScript
{{#tags}}- {{label}}
{{/tags}}