Skip to content

Instantly share code, notes, and snippets.

@facelordgists
facelordgists / php-output-buffering.php
Created January 29, 2014 22:51
PHP output buffering. Great for WordPress shortcodes
<?php
// generic usage
ob_start();
?>
<h1>Begin Content</h1>
<p>Content</p>
@azizultex
azizultex / WordPress Shortcode with ob_start()
Created March 3, 2016 03:16
WordPress Shortcode with ob_start()
function custom_query_shortcode($atts) {
// EXAMPLE USAGE:
// [loop the_query="showposts=100&post_type=page&post_parent=453"]
// Defaults
extract(shortcode_atts(array(
"the_query" => ''
), $atts));