I am trying to find out if you can enqueue a script in Wordpress that has php variables within it. If this is possible how would it be done?
I have tried this, however I get errors.
function my_scripts_method() {
wp_enqueue_script(
'custom-script',
get_stylesheet_directory_uri() . '/masonry.php',
array( 'jquery' )
);
}
add_action( 'wp_enqueue_scripts', 'my_scripts_method' );