Codex
How To Make An Ajax Request In WordPress With Admin-Ajax.php
Register a PHP handler with the wp_ajax_ and wp_ajax_nopriv_ hooks, then call it from JavaScript with fetch(). This example requires the lotgrafixData object from the wp_localize_script() post.
How To Pass Php Data To Javascript In WordPress With Wp_Localize_Script
Use wp_localize_script() to expose PHP values such as the AJAX URL, a nonce or the site URL to your JS file.
How To Load A Javascript File Only On A Specific Page In WordPress
Wrap wp_enqueue_script() in a conditional tag so the file loads only where it is needed.
How To Enqueue A Javascript File In WordPress
Use wp_enqueue_script() inside the wp_enqueue_scripts hook to load your JS file the right way.
Get Page Content By Id
Displays the full title and content of a specific WordPress page by its ID, using WordPress’s native filters to preserve the page’s formatting and generated content.


