Adding to the_content or a variable from within a shortcode function
I think, I would simply store all the definitions during the glossary_shortcode() execution in a global variable and serve them at the end of some hook like the_content. function glossary_shortcode( $atts = array(), $shortcode_content = null ) { // Your code can be kept identical, just store the $glossary_term_object somewhere. global $glossaries; $glossaries = $glossaries … Read more