filters - How to get list of all hooks of current themeplugin?

I want to get the list of all available hooks from active themefrom a specific plugin.I was tried to get it from glob

I want to get the list of all available hooks from active theme / from a specific plugin.

I was tried to get it from global variables $wp_actions & $wp_filter But, They are showing all registered hooks.

E.g.

global $wp_actions, $wp_filter;
echo '<pre>';
print_r($wp_filter);

E.g. If theme or plugin register the action in after_setup_theme then it'll list in [after_setup_theme] key from global $wp_filter.

I was tried one of the best plugin Simply Show Hooks. But, It'll also, show all the registered hooks.

Is there any way to get the specific hooks from theme / plugin?

I want to get the list of all available hooks from active theme / from a specific plugin.

I was tried to get it from global variables $wp_actions & $wp_filter But, They are showing all registered hooks.

E.g.

global $wp_actions, $wp_filter;
echo '<pre>';
print_r($wp_filter);

E.g. If theme or plugin register the action in after_setup_theme then it'll list in [after_setup_theme] key from global $wp_filter.

I was tried one of the best plugin Simply Show Hooks. But, It'll also, show all the registered hooks.

Is there any way to get the specific hooks from theme / plugin?

Share Improve this question asked Jul 12, 2016 at 10:22 maheshwaghmaremaheshwaghmare 1,07810 silver badges24 bronze badges 3
  • Don't you have a documentation of them, or in the theme/plugin website? – knif3r Commented Jul 12, 2016 at 10:25
  • I've always just used the search feature in my IDE to scan the source code path for the "do_" function calls. – C C Commented Jul 12, 2016 at 12:31
  • 1 You could run the WordPress PHPDoc parser over the plugin's code (wp parser parse .), which will create a list of hooks (in addition to all functions/classes/etc.). – J.D. Commented Jul 12, 2016 at 13:09
Add a comment  | 

2 Answers 2

Reset to default 2

As of 2016-09-25, there is no ideal solution.

The WP-Parser does the job, but you need to set up a special WP site to run it. WooCommerce's Hook-docs is something much simpler, and can be easily tweaked.

I just wrote a long comment on the topic here:

https://github/ApiGen/ApiGen/issues/307#issuecomment-249349187

As of 2019-10-16, the ideal solution would be: https://wordpress/plugins/query-monitor/

After installing the plugin, head over to your homepage (or wherever you need to get your list of hooks) and open Query Monitor from the admin bar.

Then, open Hooks & Action:

You will be able to view all the hooks in action, along with their component (e.g. plugin). You will also be able to filter by component.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745154039a4614008.html

相关推荐

  • filters - How to get list of all hooks of current themeplugin?

    I want to get the list of all available hooks from active themefrom a specific plugin.I was tried to get it from glob

    2小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信