{"id":4944656,"date":"2014-05-23T07:51:26","date_gmt":"2014-05-23T07:51:26","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/hook-after-module-infophp-is-loaded\/"},"modified":"2016-08-21T20:52:35","modified_gmt":"2016-08-21T20:52:35","slug":"hook-after-module-infophp-is-loaded","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/hook-after-module-infophp-is-loaded\/","title":{"rendered":"Hook after module-info.php is loaded"},"content":{"rendered":"<p>Hi again.<\/p>\n<p>When I want to hook into the modules info hooks (any of them), the only way to do it is right after the file is included. After that there are two hooks for that:<\/p>\n<p>a filter: jetpack_short_module_description<br \/>\nan action: &#8216;jetpack_learn_more_button_&#8217; . $module<\/p>\n<p>Those are the only moments when I can hook the moduels information. The problem is that they are executed once for every module. I think that the plugin needs an extra hook after module-info.php is loaded. Here&#8217;s an example:<\/p>\n<pre><code>include_once( JETPACK__PLUGIN_DIR . &#039;modules\/module-info.php&#039; );\ndo_action( &#039;jetpack_modules_info_loaded&#039; );<\/code><\/pre>\n<p>That would solve the problem.<\/p>\n<p>Or even better (this file is loaded in another place too I think: Add the action at the end of modules-info.php.<\/p>\n<p>Cheers.<\/p>\n<p>https:\/\/wordpress.org\/plugins\/jetpack\/<\/p>\n","protected":false},"template":"","class_list":["post-4944656","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4944656","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\/4944656\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4944656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}