
上QQ阅读APP看书,第一时间看更新
Searching for hooks in the WordPress source code
Since WordPress is open source, another way to find information about hooks is to search directly within its code. For every action hook that accepts user functions, you will see a call to the do_action function to execute all the registered items. As can be seen, the function takes two or more arguments, with the second one(s) being optional:
do_action ( 'tag', [$arg] );
For the example shown in this recipe, a search for do_action( 'wp_head' ) reveals that it is the only function that is called when a theme makes a call to the wp_head() function in its header file:
do_action( 'wp_head' );