{"id":4965880,"date":"2014-05-30T21:27:00","date_gmt":"2014-05-30T21:27:00","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/plugin-not-initializing\/"},"modified":"2016-08-21T21:06:30","modified_gmt":"2016-08-21T21:06:30","slug":"plugin-not-initializing","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/plugin-not-initializing\/","title":{"rendered":"Plugin not initializing"},"content":{"rendered":"<p>Code in plugin A calls a method in plugin B.<\/p>\n<p>B is implemented as a class with a few wrapper functions. The method called by A does a new [class name]() and then invokes a method within the class.<\/p>\n<p>The new [class name] code fires the constructor which contains:<\/p>\n<p>add_action(&#8216;init&#8217;, array($this, &#8216;init_my_code&#8217;), but &#8216;init_my_code&#8217; never gets called. The init code loads JavaScript code, but that code is not getting loaded&#8230; hence a problem.<\/p>\n<p>Is the problem related to hooking to &#8216;init&#8217; or am I missing something fundamental? Where should I be hooking to?<\/p>\n","protected":false},"template":"","class_list":["post-4965880","topic","type-topic","status-closed","hentry","topic-tag-initialization"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4965880","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\/4965880\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4965880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}