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

Otto otto at ottodestruct.com
Mon Jan 19 22:15:03 GMT 2009


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


More information about the wp-hackers mailing list