Created
April 7, 2014 03:42
-
-
Save jb510/10014524 to your computer and use it in GitHub Desktop.
WordPress Shortcode Output Buffer
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
/** | |
* Sample Shortcode | |
* @since 1.0.0 | |
* | |
* @param null | |
* @return string Site URL | |
*/ | |
function jb_sample_shortcode( $atts ) { | |
ob_start(); ?> | |
<!-- hello world --> | |
<?php $output_string = ob_get_contents(); | |
ob_end_clean(); | |
return $output_string; | |
return $output; | |
} | |
add_shortcode( 'sample_shortcode','jb_sample_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment