How can I get a link path to use for my resources such as JS scripts?

Question

Is there a function that would return the equivalent of plugin_dir_path but it being agnostic of a plugin / theme? JS scripts need to be enqueued as resources, as such, you cannot include their on-server path which is, say /var/www/html/wordpress/thing/thing2/script.js, it needs to be the http://www.example.com/thing/thing2/script.js counterpart.

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/how-can-i-get-a-link-path-to-use-for-my-resources-such-as-js-scripts/">

How can I get a link path to use for my resources such as JS scripts?</a>
0
Daniel Smith 7 months 0 Answers 60 views 0

Leave an answer