Enqueue script dinamically
There’s a fundamental misunderstanding of what AJAX does. You cannot enqueue scripts directly from the PHP called from the javascript. You need to print something that can be used by the javascript making the AJAX call. You can then use javascript to add that file to the DOM. functions.php //* Enqueue Ajax call on wp_enqueue_scripts … Read more