-
-
Save aaronjorbin/7470829 to your computer and use it in GitHub Desktop.
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
<?php | |
// embed the javascript file that makes the AJAX request | |
wp_enqueue_script( 'my-ajax-request', plugin_dir_url( __FILE__ ) . 'js/ajax.js', array( 'jquery' ) ); | |
// declare the URL to the file that handles the AJAX request (wp-admin/admin-ajax.php) | |
wp_localize_script( 'my-ajax-request', 'ajax_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment