Update Blog

Jauhari.NET menyajikan Informasi Cepat, Tepat dengan sajian Menarik

Display WordPress Hook Functions


If you are WordPress Developer, Themes Developer or Plugin Developer, you will enjoy this functions, this code original made by Rast and was published on WP Recipes. This function is perfect for me, because with this little code we can display all WordPress Hook available and we can play around with it.

Why we need learn WordPress hooks? because  are very useful because they allow you to “surcharge” an existing WP function with your own code.

Here is the Code

function list_hooked_functions($tag=false){
global $wp_filter;
if ($tag) {
if (!is_array($hook[$tag])) {
trigger_error("Nothing found for '$tag' hook", E_USER_WARNING);
else {
echo '<pre>';
foreach($hook as $tag => $priority){
echo "<br />>>>>>t<strong>$tag</strong><br />";
foreach($priority as $priority => $function){
echo $priority;
foreach($function as $name => $properties) echo "t$name<br />";
echo '</pre>';

And here is how to use it


I hope you enjoy our today WordPress Tips, you can read more details about WordPress API