[wp-hackers] Replace default doctype on one page only through plugin

Mike Schinkel mikeschinkel at newclarity.net
Mon Jan 19 22:39:42 GMT 2009


> And there you go. The callback will get called at end of execution.

Awesome!

-Mike Schinkel
http://mikeschinkel.com/

----- Original Message -----
From: "Otto" <otto at ottodestruct.com>
To: wp-hackers at lists.automattic.com
Sent: Monday, January 19, 2009 5:15:03 PM GMT -05:00 US/Canada Eastern
Subject: Re: [wp-hackers] Replace default doctype on one page only through plugin

It you're worried about nesting, then use a callback and don't call ob_end.

ob_start('plugin_callback');

function plugin_callback($buffer) {
return preg_replace( '|<!DOCTYPE[^>]*>|i', '*<!DOCTYPE..>*', $buffer);
}

And there you go. The callback will get called at end of execution.

-Otto
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list