Pretty-printing Wordpress HTML output for development purposes
Is there a simple way (plugin / function) that uses Tidy or some other lib to pretty-print Wordpress's HTML output?
It's unreadable as it is and it'开发者_Go百科s almost impossible to write a theme with proper indentation with all the includes / hooks going on all over the place.
Performance is not an issue as this only needs to be active for development purposes.
I suggest:
- Get Firebug
- Use PHP heredocs
- Include whitespace in your output using
\n
(newline),\t
(tab), etc.
Give Kint PHP Debugger a try.
Works great for doing var_dumps with a nice UI.
Example:
$items = array('pine', 'apple', array('numbers' => [1,2,3,4]));
d($items);
精彩评论