Skip to content

Instantly share code, notes, and snippets.

@supercleanse
Created July 13, 2012 17:02
Show Gist options
  • Save supercleanse/3105996 to your computer and use it in GitHub Desktop.
Save supercleanse/3105996 to your computer and use it in GitHub Desktop.
Full page modification in WordPress
<?php
add_action('init', 'fpm_start_output');
add_action('shutdown', 'fpm_end_output');
function fpm_start_output() {
ob_start('fpm_mod_buffer');
}
function fpm_mod_buffer($buffer) {
// Modification ... regexp, etc
return $buffer;
}
function fpm_end_output() {
ob_end_flush();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment