<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">Themes should never use ob_* functions. The header case mentioned here
included, it should be relegated to a plugin which wants to offer it if
it's absolutely necessary. The plugin would simply hook in at priority
1, and start buffering, and hook in at priority 1000 or similar, and
stop buffering there, do it's thing, and output; Those who "need" it,
can have it, and those that don't, don't need to worry about performance
issues or the possibility to use it wrong, and the theme remains as
clean (as it should)<br></blockquote><div><br>In my opinion, this is the first reasonable alternative that's been presented. Personally, I wouldn't really consider this a <u>better</u> solution; just a <u>different</u> solution.<br>
<br>Here are some concerns that come to mind--questions I don't have an answer to:<br><ol><li>What if another plugin uses the same priority? In other words, how would the buffer plugin recover in situations where another plugin attaches to the same priority numbers, but is called after our plugin? Would this other plugin effectively "steal our spot" in the call stack? Would our plugin be bumped down in the stack? Replaced? Fatal error?<br>
</li><li>What happens if the condition described in the previous bullet point occurs at one end but not the other? In other words, what if our plugin opens the output buffer but is prevented from closing it? Vice versa?</li>
<li>What if I want to include theme functionality that relies on this output buffering? Should I require all theme users to install the plugin, just for the sake of keeping my theme "clean"? In other words, would a "clean" theme be accepted into the WP repository if it wasn't 100% functional out-of-the-box?<br>
</li><li>My biggest concern is simply whether or not using a plugin for this would even work. For example, where in the overall execution thread would our custom function (the one that processes the output of wp_head) be called, and how might this differ between a plugin-based solution and a theme-based solution? Does this even matter? Every time I try to step through the code in my head, I get stuck in an infinite loop. :(</li>
</ol><br>As a side note, I'd like to address this sentiment:<br><br><blockquote style="margin: 0pt 0pt 0pt 6.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex; color: rgb(153, 153, 153);" class="gmail_quote">
<i>Themes shouldn't try to correct plugins, Themes should display what
WordPress tells it to, and style it according to the users & plugins
wishes...<br></i></blockquote><br>This is just one example of what seems like an endless stream of pretentious opinions being dictated as facts to the general subscriber base of this mailing list. If every discussion thread ends with an unsupported statement from a WP veteran, why even have a mailing list in the first place? We could all save ourselves a heap of trouble if those WP vets just wrote a list of their opinions, called it "WP Theme Laws," and posted it somewhere.<br>
<br>Assuming one of the goals of this mailing list is to actually facilitate community participation and solicit unbiased feedback, then I'd say we're failing. Collaboration means more than "a group of individuals taking turns proclaiming their self-righteousness." In my opinion, that is.<br>
</div>