Skip to content

Instantly share code, notes, and snippets.

@farinspace
Last active February 27, 2016 03:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farinspace/39c8c35acd945575dea1 to your computer and use it in GitHub Desktop.
Save farinspace/39c8c35acd945575dea1 to your computer and use it in GitHub Desktop.
Noon Plugin "nooz_shortcode" filter usage example.
<?php
function my_custom_template( $output, $data ) {
// loop $data['items'], use post ID, to get additional meta data if needed
// ...
// filter by type to output different templates
if ( 'coverage' == $data['type'] ) {
ob_start();
// $data variable is available inside PHP file
include_once 'my_custom_template.php';
$output = ob_get_contents();
ob_end_clean();
}
return $output;
}
add_filter( 'nooz_shortcode', 'my_custom_template', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment