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
- Adding a second email address to a completed order in WooCommerce [closed]
- Advantages and disadvantages of using automatic-feed-links
- Is it possible to override this function/class in a child theme?
- Change meta tags programatically
- Convert hyphen to underscore in permalinks
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Use a function to update post meta based on other post meta
- Adding body class when post contains a specific shortcode
- Displaying Widgets
- Display WooCommerce subscriptions for user [closed]
- Increment price for Woocommerce Minicart [closed]
- Change woocommerce products weight varation based its product category or tags? [closed]
- Completely disable RSS feeds on WP 5.5.2 and show a 404 page instead of die();
- Check if row exists before inserting
- How to properly add function called by action-hooked function to functions.php?
- Get Current User info using wp_localize_script, in functions.php
- How to add new embed handler not supported by oembed?
- How do I add Bootstrap and LESS to my migrated WordPress site?
- Stuck on maintenance mode
- How to display custom option field in woocommerce orders in admin panel?
- Best practices regarding the creation of custom widgets?
- How to remove style attribute in WordPress RSS output?
- Multiple Loops Meta Data
- Update user meta of author when post content is viewed
- If ACF field is empty show different value [closed]
- What is the text that appears beside the page titles in the list of pages in the WP admin?
- How i can put $_GET codes in function.php?
- Is there a way to direct unregistered user to registration page when click a link?
- Auto log in hook is requiring a page refresh
- how to get the post ID from wp_insert_post
- Possible to merge these two functions?
- The Capability to choose post/page template
- The_content and Preg_replace in loaded Iframe [closed]
- dynamic site link for future migration in echo do_shortcode()
- Hide tab Buddypress profile for visitors, not logged in users
- Add a mature content warning to first-time visitors
- Show Featured Image in else statement
- Simplest Way to Build Custom Archives Page?
- Filter for replacing the WP_query object for a given category
- Custom user role still showing up after deletion, ideas?
- wordpress built-in Jalali date convertor
- WordPress Function Assistance with Loop
- Populate acf-field, depending on block name
- Add Change role button for list of user in an event
- I am trying to set post terms to a custom taxonomy
- how to increase connection time
- Shortcode to insert default text and change one word throughout it?
- Classic TinyMCE messing up only Contributor’s HTML
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- Add schema to Search result page’s body. Tried using is_search
- Hide disclaimer from summary excerpts
- WordPress Javascript Widget jQuery Dependency Issue
- Open image size links in a page instead of direct image link
- Allow tags and attributes in post and pages content
- Function to get thumbnail img source
- Syntax for a function in order to get post’s title in JSON encoded response [closed]
- Comment Function
- Do something when user creates post (that’s pending)
- Add product to cart from functions.php
- How do i set global variable in a function in wordpress functions.php