Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Wordpress shortcode function: echo vs return
// Don't use echo in the shortcodes. If you have to, use ob_start() / return ob_get_clean()
add_shortcode('test', 'my_test_func');
function my_test_func( $args ) {
your content / html / etc
return ob_get_clean();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.