You can use error_log()
and print_r()
:
add_action( 'wp_footer', 'wpse_debug_toolbar' );
function wpse_debug_toolbar() {
global $wp_admin_bar;
error_log( print_r( $wp_admin_bar, true ) );
}
Note that when using print_r()
we’ve set the second parameter $return
to true
so that the results are returned and not echo’d.
Related Posts:
- How to define WP_DEBUG as true outside of wp-config.php?
- What does this message from WP_DEBUG mean?
- Undefined constant with debug set to true
- WordPress not writing error.log
- Undefined index: id, when I save the options [closed]
- How to debug ‘Notice: Undefined index’ on a Request[‘action’]
- website has a bug
- Notice: Use of undefined constant – assumed ‘ ‘
- Define WP_DEBUG conditionally / for admins only / log errors (append query arg for all links?)
- WP_DEBUG is not set, but I’m still getting warnings
- Control verbosity level of WP DEBUG?
- How to check if debug is true and can I use it for my own code? [duplicate]
- Suppress deprecated notices
- Debug.log file is never created?
- What is the best way to monitor PHP functions/executions?
- Hide php Notices in Dashboard
- How to override WP_DEBUG for Ajax responses?
- How to individually set WP_DEBUG on a sub-directory multisite?
- Prevent notice and warnings in error_reporting?
- How to debug vars inside function at functions.php file?
- How to debug when error_log not working as expected
- Where should I tell WordPress where error_log messages should be written?
- How do I set up Debugging?
- Disable Debug Log Programmatically
- How to debug WordPress correctly?
- WordPress Errors in generated by theme check plugin [closed]
- error_log is not working as expected in functions.php file
- Inserting Post Using wp_insert_post. How to Fill Yoast Plugin SEO Fields
- Prevent wp_debug from polluting ajax within plugin
- add_sub_menu page() to be replaced by add_theme_page()
- Using debug log in production, is that a security concern?
- Notice: Undefined index: suppress_filters
- WordPress: Adding Security
- How to show the error causing the ‘There has been a critical error on your website’?
- Wordpres debug.log PHP Notice: is_singular was called
- Same log message keeps on printing to debug.log file thousand of times
- How to fix Uninitialized string offset: error on a checkbox in WP Settings API
- Failed to open stream: HTTP request failed! in \wamp\www\wordpress\wp-includes\class-http.php on line 929
- How do you change error reporting to only show errors in WordPress?
- WP_DEBUG must be on, otherwise edit post or page will show 404 error
- WordPress customizer Preview not loading
- PHP-FPM WordPress Debug
- XAMPP-VM Mac OS Mojave wordpress debugging using XDebug
- Wordress debug log is not working
- Why does WordPress keep showing me error messages?
- “Undefined index” error when saving empty array with checkboxes
- White screen on front page only
- Style WP_Debug?
- Is it possible to enable and disable wp debug from functions.php?
- WordPress debug messages not displaying
- Why does WP_DEBUG only work after wp_debug_mode() is called? [closed]
- Getting a WordPress Debug Strategy
- I have this error notice ‘wp_enqueue_script was called incorrectly’ in my plugin
- Warnings even when the WP_DEBUG set to false
- WordPress Cron job, 302 response
- what are WP_DEBUG conditions?
- How to receive notification of deprecated API elements and functions?
- Undefined index error on options array element?
- WordPress 6.x / PHP 8.x deprecated warnings in development environment
- There is no any line related the error but it says critical error
- error log is going to the wrong location, WP_DEBUG_LOG is ignored
- How to display only specific Error types in debug.log? No notices, warnings, etc
- How do I specify where to save the debug.log?
- admin_post_(action) hook create console log error
- Notice: Undefined index: post_title error
- Cannot read property ‘hasClass’ of undefined(…) jquery-ui
- Unnessary character on post after restore
- Debugging conundrum with a problem fixed by enabling WP_DEBUG
- Which language files are loaded?
- WP Debug set to true but still wsod
- Some ways to debug code
- Pick your brain on wp-config.php if statement for multisite
- Undefined offset: 2
- Notice: Trying to get property of non-object in options.php
- TGM plugin error in Theme Check Plugin
- Fatal error trace not shown in development setup
- Many big issues in the website, WP_Debug not showing
- Automated WordPress update failed to complete – but all updates fail with code -1