You can use var_dump() instead of print_r() – you get the type and the value of the variable and it will also work when your variable holds FALSE or NULL.
print_r( false ); # doesn't output anything
var_dump( false ); # output: bool(false)
print_r( NULL ); # doesn't output anything
var_dump( NULL ); # output: NULL
If you have arrays or objects to inspect, you could use a plugin like Kint Debugger to format the output into a more readable format.
Related Posts:
- debugging errors.. how to remedy?
- wp_enqueue_script was called incorrectly
- Remove type attribute from script and style tags added by WordPress
- How to debug vars inside function at functions.php file?
- How to display error messages using WP_Error class?
- Remove Menu Page Giving Error
- Functions.php reverted to new one
- Why is my Gutenberg block returning an error after initial save?
- Warning: : DOMDocument::loadHTML(): Empty string supplied as input in functions.php when adding classes to post images
- Parse error after modifying the template menu [closed]
- Dumping variable in custom pre_gets_post function in functions.php, returns NULL
- help I changed one currency in woocommerce and everything is ruined [closed]
- Need help getting a function to function
- Connecting to a 2nd DB gives me no results when querying
- register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead
- the_posts_pagination() function returns missing page numbering on some blog pages
- Functions Error: Impacting Galleries
- Strange error from functions.php files (wp_register_script)
- Show errormessages on wrong username/password on custom loginform?
- Problems with functions.php! Error! [closed]
- Looking for Functions File that doesn’t Exist
- functions.php pharse error on complete new install
- Getting value of variable from functions.php and debugging it
- “Conditional query tags do not work before the query is run. Before > then, they always return false. “
- Move product attributes after summary on single product page
- MCAPI.class.php showing some error
- I’m getting invalid taxonomy in init action
- Translation Function missing text-domain [closed]
- What is wrong with functions.php? Fills error log with same error
- Random text changing to weird icons in both admin & front end
- jQuery HoverIntent is not a function
- Fatal error after changes to functions.php, even with original file
- create submenu page – error function not found or invalid function name
- Why does modifying my functions.php file always result in a server error
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73
- Woocommerce – Checkout error message
- How to fix enqueue_styles error for a twenty-seventeen childtheme
- Comment turned Invisible
- Logout redirect via page template without confirmation?
- Convert Image to Webp on upload without plugin
- Rewrite standard $errors messages output via function.php
- Add class to menu items of one specific menu (nav_menu_css_class)
- What is the best way to monitor PHP functions/executions?
- How do I create a new WP admin color scheme?
- Using add_filter() in Widgets
- How can I add an extra WooCommerce hook
- Add attribute to link tag that’s generated through wp_register_style?
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Authors details such as social media links, emails etc → Is this Meta or something else?
- Default or Preset Content for Custom Post Types
- Problem using is_single() to enqueue script from functions.php
- If function exists, and array is met, echo function?
- display public excerpt for private post
- automatically adding submenu items
- Functions.php: If its single?
- How to add another user to this remove_menu function?
- Dequeue script in template isn’t working
- How do I call wp_mail from HTML?
- wp_link_pages: display current page number only if has multiple page breaks?
- RSS Feed has no styles in chrome – function to add one?
- change default option in wp_dropdown_categories
- Adjust which tempalte a page uses with a function?
- How to change menu icon which is overriden (i.e. by WooCommerce) [closed]
- WordPress Content Security Policy and Subresource Integrity
- How to use IF Statement in WordPress?
- Display trackbacks separately from comments in twentyeleven
- modify a function filter
- Change the slug of a particular page every x hours
- Use of undefined constant bloginfo
- Pass parameters to function through an action
- Add class or ID to any WordPress function
- How to filter out shortcode when displaying the_excerpt() in the loop?
- wpautop – disable tags, keep tags
- Logout hyperlink within a sub-menu
- Change Admin Bar “Visit Site” URL
- exclude a category from a search on a specific page
- How do I pass arguments for multiple functions hooked to a single action?
- Manipulate Permalink
- Possible to display shortcode based on the category?
- Change the HTML of the comment form that is generating somewhere from the core WordPress
- How to set default archive image without overriding first attached image? [closed]
- Toggle User Roles with button
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- Passing a variable via wp_head and then calling it on the page
- Twentyten Child Theme: header images display messed up in admin panel
- How to make custom column Admin>Users sortable?
- Theme functions.php file auto delete everyday [closed]
- How to get the index number of the posts?
- Removing wp_login_viewport_meta
- Mute Debug Messages from Plugins
- Get Current Post ID in functions php, meta query filter
- Two Types of settings in WP – The Doubt
- How to know which ajax file or function is called for action
- How to filter $content in shortcode function
- Custom Attachment Caption Fields
- Jquery implementation not working on page reload
- Generating dynamic css into custom file [closed]
- How to call particular funcion when the check box is checked in plugin options page
- Call WordPress function outside of WordPress
- Move Custom Fields on General Settings Page to New Location