Last active
February 27, 2016 03:32
-
-
Save farinspace/39c8c35acd945575dea1 to your computer and use it in GitHub Desktop.
Noon Plugin "nooz_shortcode" filter usage example.
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 | |
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