I am looking to get an ACF field that is on a CPT inside some custom jQuery. This jQuery is in a file that is already being queued via functions.php. It’s a text field that I need to display on a page that is not the CPT, so that’s why the post_id is in there. What i have currently is showing up as commented out (not sure by what though).
You can’t put PHP inside a JS file unless the JS file itself is parsed as PHP, which it isn’t. The easiest way would probably be to add the JS with PHP inline to the document header, possibly using the wp_head action hook (I’m not very experienced with action hooks, that’s just what I would assume is approrpiate).