Perishable Press

Perishable on Tumblr-- it's about time..
Oct 01
Permalink

WordPress Source Code Formatting

I get obsessive about source-code formatting. When viewing the source code of my pages, I like everything to nest properly, with the correct number of tabs preceding each line of code. With WordPress, this generally requires some tweaking of the core files.

Specifically, in wp-includes/formatting.php, the function wpautop needs a few extra \t’s before the <p>$1</p> on around the sixth or seventh line of the function.

The number of added tabs will vary depending on the specific nesting requirements of your theme. Also note that this formatting edit will affect both post text and comment text output.