Last active
August 29, 2015 14:00
-
-
Save zedejose/4edda33e9819fc4fcd3d to your computer and use it in GitHub Desktop.
Get Entire Post Or Page In A PHP Variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// From http://www.smashingmagazine.com/2009/08/18/10-useful-wordpress-hook-hacks/ | |
function callback($buffer) { | |
// modify buffer here, and then return the updated code | |
return $buffer; | |
} | |
function buffer_start() { | |
ob_start("callback"); | |
} | |
function buffer_end() { | |
ob_end_flush(); | |
} | |
add_action('wp_head', 'buffer_start'); | |
add_action('wp_footer', 'buffer_end'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment