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
- warning: trying to access array offset on value of type bool ACF field image group
- Rewrite standard $errors messages output via function.php
- wp_footer hook causing text to show on bottom of page
- how to remove a tag in the_category function
- How to modify or override a core function (wp_star_rating)
- How Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?
- Classic TinyMCE messing up only Contributor’s HTML
- Load CSS file conditionally
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- Only display table in the_content() in canonical page
- Button click counter for login user
- Menu and category highlighting for a single post
- locking content with overlay/pop up ads
- How to use `foreach()` in ajax call
- Change ‘Categories’ to ‘Topics’
- Remove action hook from Class, understanding OOP
- CSS disabled after getting rid of emoji
- Auto copy value from specific user meta field to another field
- How do I create a child theme from PowerMag theme
- Variable function names
- Change default color scheme in twentyfifteen child theme?
- WordPress Toggle Menu has stopped working
- Restrict access if logged out except for homepage
- Add meta data in head from theme
- Why is the term of my current page not returning a slug?
- Create New User Custom Field not Saving
- How to add styles in existing function?
- Keep Admin Logged In For a Year
- what is `get_section()` and how to use it?
- Override plugin function to show invoices even if not logged in
- get_field() with ID in one signal filter not working
- How to change form action of wp-login page with a function
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- function replace_text for entire page
- Changing author links on homepage to buddypress profiles – without affecting ability to link to author archive throughout the site
- i can’t use wordpress functions in ajax loaded php file
- Trying to load JavaScript only on pages within a PODS category/ custom post type
- How to add link rel tags on paginated posts?
- Woocommerce – Switching Price for Category
- Creating a “Related Meta” type field?
- Altering page / category names in breadcumbs
- Get value of pre-populated Gravity forms field as variable in my function
- How would I correctly implement a new if statement in a child functions file?
- Change user role based on total number of items ordered
- Help wiht adding fullcalendar.io to a WordPress page
- WP Enqueue Script Error
- Enqueue JS + CSS via a child theme functions.php file?
- Link to an externally created photo albums
- Multiple Notifications SetInterval
- Function stops working
- how can I change the read more link destinations and direct all to the same page?
- Shortcode displaying outside the div [duplicate]
- Hide empty custom field
- Removing sanitize_title_with_dashes Function with The Real Title
- How to add publish/draft button in Admin Post Lists
- Woocommerce custom calculation function
- button to toggle css styling / div visibility?
- add product thumbnail to checkout page only and include variation name
- Lost Your password Hook Not Showing Up
- Need Help Understanding Debug Log Errors