{"id":9831027,"date":"2018-01-03T18:04:51","date_gmt":"2018-01-03T18:04:51","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/wp_enqueue_scripts-minor-bug\/"},"modified":"2018-01-03T18:04:51","modified_gmt":"2018-01-03T18:04:51","slug":"wp_enqueue_scripts-minor-bug","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/wp_enqueue_scripts-minor-bug\/","title":{"rendered":"wp_enqueue_scripts minor bug"},"content":{"rendered":"<p>Hi.  Thanks so much for making this plugin. It&#8217;s worked really well for us.<\/p>\n<p>I think I found a minor bug.  It might have only started with one of the new WordPress versions.  With debug mode on, I get the following error at the top of the admin:<\/p>\n<p>Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in \/var\/www\/dev2\/public_html\/wp-includes\/functions.php on line 4146.<\/p>\n<p>I replaced line 42 of the main plugin file with:<\/p>\n<p>add_action(&#8216;enqueue&#8217;, &#8216;wp_enqueue_scripts&#8217;);<br \/>\nfunction enqueue() {<br \/>\n\twp_enqueue_style(&#8216;modern_footnotes&#8217;, plugin_dir_url(__FILE__) . &#8216;styles.min.css&#8217;, array(), &#8216;1.1.0&#8217;);<br \/>\n\twp_enqueue_script(&#8216;modern_footnotes&#8217;, plugin_dir_url(__FILE__) . &#8216;modern-footnotes.min.js&#8217;, array(&#8216;jquery&#8217;), &#8216;1.1.0&#8217;, TRUE);<br \/>\n}<\/p>\n<p>This resolved the problem!<\/p>\n","protected":false},"template":"","class_list":["post-9831027","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9831027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9831027\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9831027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}