[wp-hackers] is there a hook firing right after the </html>?

Otto otto at ottodestruct.com
Mon Feb 2 21:34:31 UTC 2015


On Mon, Feb 2, 2015 at 3:21 PM, Haluk Karamete <halukkaramete at gmail.com>
wrote:

> > Output buffer callbacks are automatically called at the conclusion of the
> > script.
>
> Automatically called bhy WordPress?



No, by PHP itself, actually.

When you create an output buffer using ob_start() and fail to clear it with
an appropriate ob_end_* call, then PHP will flush the output buffer at the
end of script execution.

Notably, this actually happens before any callbacks that were passed to
register_shutdown_function() are called. Shutdown functions don't get the
contents of the output buffer.

-Otto


More information about the wp-hackers mailing list