开发者 | marcusviar |
---|---|
更新时间 | 2020年2月7日 16:58 |
捐献地址: | 去捐款 |
PHP版本: | 5.6.20 及以上 |
WordPress版本: | 5.3.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
$my_string = 'My String'; do_action( 'php_console_log', $my_string );
Pass in an array
$my_array = array( 'elm 1' 'elm 2', ); do_action( 'php_console_log', $my_array );
Pass in an associative array
$my_array = array( 'key 1'=>'elm 1', 'key 2'=>'elm 2', ); do_action( 'php_console_log', $my_array);
Pass in an unlimited number of arguments nested to an unlimited depth (multi-dimensional array)
$my_array = array( 'My String 1', 'My String 2', array( 'elm 1', 'elm 2', ), 'My String 3', array( 'key 1'=>'elm 1', 'key 2'=>'elm 2', 'key 3' => array( 'key 3a' => 'elm 3a', 'key 3b' => 'elm 3b', ), ), 'My String 4' ); do_action( 'php_console_log', $my_array);
/wp-content/plugins/php-console-log
directory, or install the plugin through the WordPress plugins screen directly.If PHP Console Log is working and you have not called do_action( 'php_console_log', 'My String or Array' ); you will see a message similar to this in your browsers web console:
----------- PHP Console Log ----------- Place the do_action( 'php_console_log', 'My String or Array' ); function anywhere in your WordPress plugin PHP code. The value(s) you pass into do_action( 'php_console_log', 'My String or Array' ); will be logged to the web console in your browser. See "Help" link found on plugins page in your WordPress Admin for more information. ----------- PHP Console Log -----------
The most common reasons that cause PHP Console Log to fail when logging your information to the web console are:
Press Command+Option+J (Mac) or Control+Shift+J (Windows, Linux, Chrome OS) to jump straight into the Console panel. source: (https://developers.google.com/web/tools/chrome-devtools/open#console)
Select Develop menu in the menu bar, choose Show JavaScript Console If you don’t see the Develop menu in the menu bar, choose Safari > Preferences, click Advanced, then select "Show Develop menu in menu bar". source: (https://support.apple.com/guide/safari-developer/develop-menu-dev39df999c1/mac)