{"id":1672,"date":"2011-07-04T18:11:43","date_gmt":"2011-07-04T15:11:43","guid":{"rendered":"http:\/\/mummila.net\/kommentit\/?p=1672"},"modified":"2011-07-04T18:11:43","modified_gmt":"2011-07-04T15:11:43","slug":"you-should-use-wp_enqueue_script-also-when-including-the-plugin-script","status":"publish","type":"post","link":"https:\/\/mummila.net\/kommentit\/2011\/07\/04\/you-should-use-wp_enqueue_script-also-when-including-the-plugin-script\/","title":{"rendered":"You should use wp_enqueue_script also when including the plugin script"},"content":{"rendered":"<p>I&#8217;d supplement saibot&#8217;s answer by saying that, instead of a raw\u00a0<code>&lt;script&gt;...&lt;\/script&gt;<\/code> block, you should\u00a0<a href=\"https:\/\/codex.wordpress.org\/Function_Reference\/wp_enqueue_script#Load_a_script_from_your_theme.2C_excluding_admin_area\">use\u00a0<code>wp_enqueue_script()<\/code><\/a> also when including the plugin script:<\/p>\n<pre><code>&lt;?php wp_enqueue_script(\"jquery-cookie\", get_bloginfo('template_url').'\/jquery.cookie.js', array(), '0'); ?&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;d supplement saibot&#8217;s answer by saying that, instead of a raw &#8230; block, you should use wp_enqueue_script() also when including the plugin script.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1097],"tags":[2965],"class_list":["post-1672","post","type-post","status-publish","format-standard","hentry","category-keskustelupalstat","tag-wordpress","sijainti-stack-exchange"],"_links":{"self":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts\/1672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/comments?post=1672"}],"version-history":[{"count":7,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts\/1672\/revisions"}],"predecessor-version":[{"id":1679,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts\/1672\/revisions\/1679"}],"wp:attachment":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/media?parent=1672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/categories?post=1672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/tags?post=1672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}