Debug Tools For WordPress / PHP – current_filter and debug_backtrace

We have already discussed error_log here

The current_filter() function will return the current WordPress filter or action calling a specific function. The return type is string, so it’s straight forward to just use it.

Add the following inside the function to know which WordPress action or filter is calling it. 

error_log( "\n Current action / filter = " . current_filter(), 3, ABSPATH . "/my_error_log.log" );

Another PHP tool is debug_backtrace().

error_log( "\n " . print_r( debug_backtrace( true, 2 ), true ), 3, ABSPATH . "/my_error_log.log" );
Hello, I am Arun Basil Lal. Thank you for reading!

I am a WordPress product developer and creator of Image Attributes Pro. I am passionate about solving problems and travelling the world.

Divi WordPress Theme - My Review

Divi WordPress Theme
Divi is a WordPress theme that web designers do not want you to know. It comes with a drag-and-drop theme builder. You can build beautiful looking unique websites without touching a line of code. Just choose from one of the many pre-made layouts, or pick elements and arrange them any way you like.

Divi is every WordPress developer's wet dream. Surprise your clients with neat responsive websites and have fun building them.

Divi comes from Elegant Themes. If you enjoy building websites, you *need* an Elegant Themes membership. 87 beautiful themes and 5 plugins for the cost of less than a candy-bar each!


Note: I am an avid user of Divi myself and this is a honest review. I wouldn't recommend something that I do not personally find amazing.

Leave a Reply

Your email address will not be published. Required fields are marked *

*