Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Customizer API Native WordPress Customizer Settings Site Title and Tagline

John Dugan
PLUS
John Dugan
Courses Plus Student 13,165 Points

var_dump formatting and syntax highlighting

Howdy Zac,

Are you using a browser extension or a WordPress plugin to allow formatting and syntax highlighting on your var_dump($wp_customize)?

I am having to echo out pre tags - but that doesn't give me syntax highlighting :-/

    echo '<pre>';
    var_dump($wp_customize); // debug entire object
    // var_dump($wp_customize->panels()); // debug panels
    // var_dump($wp_customize->sections()); // debug sections
    // var_dump($wp_customize->controls());  // debug controls
    echo '</pre>'; 

1 Answer

John Dugan
PLUS
John Dugan
Courses Plus Student 13,165 Points

Found the solution for anyone else viewing this question.

Installing the XDEBUG extension for PHP did the trick. They have a nice wizard that will help you properly update your php.ini file.

Hat tip to this forum thread as well: https://teamtreehouse.com/forum/vardump-unformatted-output