So you know how Drupal has functions in modules like Devel that allow you to output arrays in a nice format like dsm($array) or krumo($array)... Does WordPress have an equivalent or a nice way of displaying print_r($array)?
|
|
|||||||
|
|
I created a Kint plugin that works really well. I also integrates with the Debug Bar plugin. You can download it at: http://wordpress.org/extend/plugins/kint-debugger/ There are a few functions to help you out with WordPress specific globals:
For printing arrays in a styled, collapsible format you would do the following.
|
|||||
|
|
You can install and use Krumo with WordPress (or any php app really). there's the Hikari Krumo plugin that simplifies use, though check the comments there, there's an error that you'll need to manually fix to get it working with latest WP. There's also the WordPress Debug Bar plugin which you might find useful. EDIT- Another option I've recently discovered, Kint. |
||||
|
|
|
For this kind of stuff, I wrote REF (requires PHP 5.3). Among many other features, it displays contents of DocBlock comments and linkifies PHP-internal classes, methods and functions (links point to the PHP manual). It also handles WordPress functions (links point to queryposts.com). Here's the output of
|
|||||||||||||
|
|
Also you can use the plugin Debug Objects; list also scripts and styles. The Plugin has many more options for dev and debugging, but also this feature. Alternative is this source, you find informations and the post about this topic here:
|
|||
|
|
|
Why not just use xdebug? Looks pretty neat to me, by default.
There is also Kint, http://code.google.com/p/kint/ but I found the dropdowns more confusing, then the full output of xdebug. |
|||
|
|
If you just wrap the |
|||
|
|
