• I need buffer the output of my wordpress account. What I want to do is call ob_start() before anything is output to the browser and ob_get_clean() after ALL is said and done. Then I want to do some filtering of the output. Does this make sense? Does anybody know how I can hook into these actions? Basically I need the EARLIEST possible hook and the LATEST possible hook.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    For output buffering, hook to ‘init’ and ‘shutdown’. Shutdown is the last hook there is, and init, while not the first hook, is the first place that you can safely hook up an output buffer without breaking things.

    Although you really don’t need to hook to shutdown to make an output filter. Just hook to init and do an ob_start with a callback function. Your callback function will get the output as the first parameter as the last thing it does.

    Thread Starter visinoni

    (@visinoni)

    thanks I got it working and I did exactly what you said 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need to hook into pre-output and post-output’ is closed to new replies.