The most used Wordpress hooks
Created:28 Nov 2016 20:53:05
Below is a list of the most often used hooks (sorted by the number of callbacks attached )
on a vanilla installation of WordPress (v.4.6.1) with twentysixteen theme loaded.
On such a setup, in total I found 261 hooks, something was attached to.
As seen in the list, the most used hooks were: wp_head (24 callbacks attached),
the_content(10 callbacks) attached and everyone's favorite init with also 10 callbacks.
126 callbacks were attached to the 20 hooks, which comprised 27.6% of total number of executed callbacks at every request. For completeness, 456 callbacks were executed every time I refreshed index page.
No wonder Wordress feels slow without some initial optimization.
WordPress hooks array
If you would like to count hooks and callbacks by yourself, they are stored in wp_filter array and can be accessed through $GLOBALS['wp_filter'].
Here is (a shortened version of ) the list of the most used Wordpress hooks and callbacks attached to them.
This post was updated on
04 May 2017 23:11:28
Author, Copyright and citation
Author of the above article, Sylwester Wojnowski, is sWWW admin and owner.He enjoys doing Maths and studying algorithms, writing code
in scripting and command languages, Thrash Metal music and playing electric
©Copyright, 2019 Sylwester Wojnowski. This article may not be reproduced
or published as a whole or in parts without permission from the author.
If you share it, please give author credit
and do not remove embedded links.
Computer code, if present in the article, is excluded from the above and licensed under GPLv3.
Cite this article as:
Wojnowski, Sylwester. "The most used Wordpress hooks." From sWWW - Code For The Web . https://wojnowski.net.pl//main/index/the-most-used-wordpress-hooks