javascript – Why is it recommended to insert JS through the theme, plugin, etc rather than in the post directly?

Question

Say I have a JS script that is only needed to be used in some pages. According to this advice it is recommended to insert it through the theme, plugin, etc, not through the post. Why is that? Is it for security or management?

Related question: What are the benefits of using wp_enqueue_script?

0
Ooker 7 months 2022-01-08T01:54:12-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse