Skip to content

Commit

Permalink
feat: add support WP debug function
Browse files Browse the repository at this point in the history
  • Loading branch information
agung2001 committed Jul 8, 2023
1 parent 06e4a2c commit 74b4008
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/WordPress/Helper/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,17 @@ class Helper
use Template;
use Validate;
use User;

/**
* WordPress debug function.
* - Please don't forget to turn on WP_DEBUG_LOG to true otherwise this function will not work.
*/
public function debug($log)
{
if (is_array($log) || is_object($log)) {
error_log(print_r($log, true));
} else {
error_log($log);
}
}
}

0 comments on commit 74b4008

Please sign in to comment.