What I do, when I’m developing a plugin (or theme) on a local WordPress install and I’m feeling lazy, I just use a combination of
var_dump($my_variable);
die; // exit; works too
This way I get an idea whats going on and I see when the variable stops being what I expect it to be.
Another thing I sometimes do is I use error_log( print_r( $my_variable, true ) );
inside functions to push stuff into the error log so that I can review it later.
Unfortunately I haven’t worked that much with custom tables so I can’t comment on those matters.
Related Posts:
- Associate multiple email addresses with the same user account, so they can log in with either
- Difference Between Filter and Action Hooks?
- How many times will this code run? (or, how rich is grandma?)
- Which hook should be used to add an action containing a redirect?
- add_action hook for completely new post?
- How to debug a plugin with Xdebug?
- Send user activation email when programmatically creating user
- Add a new tab to WordPress Plugin install Listing
- Changing Plugin Load Order
- Admin settings update updating every time home page is hit?
- WordPress Hook for user register
- Get list of scripts / styles and show file which enqueued them
- Global Objects and Public Methods
- Email verification for new users
- Using filters and actions for plugin API?
- How should you hook a session_start() when authoring a plugin?
- Init action hook running late after PayPal’s return url?
- Is there widely accepted phpDoc syntax for documenting which hook calls a function?
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- How Do I Load My Action Earlier Enough?
- Does WP fire delete_post when trashed posts are automatically deleted?
- What’s the earliest point I can get the queried object ID?
- How do I Make a Theme “plugin-ready”?
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- WordPress scheduled task is called but not executed
- How to add a link to WordPress Plugin install Listing
- How to modify post content before writing to database?
- I can’t find where a hook is being defined in a plugin – Easy Digital Downloads
- Call activation hook multiple times
- How do I handle multiple Submit buttons in plugin’s option page?
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- Two-step login process – Is it possible?
- How to check if certain plugin exists and in expected version
- Adding callback function for wp_ajax_ has no effect
- How to debug WordPress correctly?
- Plugin development, hooks, generate content
- Is it possible to create an action hook using do_action() within add_action()?
- Custom user profile, registration, login page with theme
- How can I hook into existing WordPress Bulk actions?
- Hook for post permalink update
- Dynamically Override Fancy Title
- Get returned variable from a function to add_shortcode function
- Hook event for upload image in the menu
- Help with callback using do_action_ref_array
- Earliest WP Hook to Safely and Reliably Redirect
- Define a function outside a class and call the function using action or filter hook
- Is it possible to modify the media library admin screen?
- What function to hook for changes made in status and visibility of a post
- Create a plugin to change the action to which a function is hooked
- Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
- Synchronize Custom post type tags to WordPress default posts tags
- Adding Automatically To In WordPress Using Filter Referencing?
- Order of Operation for these three hooks
- comment_email hook doesn’t seem to work for comment editor field
- Why is the reset password key missing in the reset password email?
- Best Practices for Creating and Handling Forms with Plugins?
- Is there a better way to implement responsive images than what WordPress uses by default?
- Modifying values with add_action to be sent to db
- Woocommerce – Hide a Column in Cart Table
- unable to stop loop when using wp_insert_post with publish_post hook
- save_post hook not triggered in WP v3.6.1
- Hook into theme-switching later than `setup_theme`
- Add tab to profile.php wordpress plugin development
- Is it possible to delay execution of shortcode output callback?
- WordPress Ajax callback function from plugin – OOP
- Find source of notice / warning / errors efficiently
- Hook to get image filename when it is uploaded
- Get the password key when using the wp_new_user_notification_email filter
- How to display a message about updates in the plugin list
- Why my database table not created on activation?
- How to get the ID of the currently logged in user?
- How do I change the initial quantity of a product in woocommerce?
- How to delete an user including data from custom database tables
- Act on user meta updated, but only once
- Where and how does WordPress store and use its plugin and hook information?
- How to debug a unit test for a WordPress plugin, which uses wordpress-test?
- Is there any way to allow a plugin to write over a previous version?
- Which are the hooks run before/after when a category’s deletion?
- Should action callbacks start with a verb?
- Execute Hook on the footer or header after activating a plugin
- Why is my javascript not invoked in my hooks except wp_head?
- edit_{$taxonomy} | Hook
- WordPress after content Hook & external template part
- Namespaced action and filter tags
- What filter should I use to insert a button inside on Media>Add New
- Two functions utilizing registration_errors filter
- best practice for query string values – get_query_var always empty for my value supplied in query string
- get_current_screen() return null
- How do I add a prefix when a user registers
- Modifying meta tags after doing ajax call in plugin
- how to add custom functionality after woocommerce place order button
- .mo translation strings not loading in PHP scripts that handle AJAX calls
- How to add custom fields to the all users page
- How to use a hook to override an update_post_meta call in a plugin?
- External Authentication, session_tokens not destroyed on logout
- SMS registration and login [closed]
- Where to add hooks in a class
- Trying to understand order and frequency of action hooks firing