Exemple de tampon PHP pour renvoyer le balisage du shortcode

logo carre@4x

Brut

/**
 * Example of PHP buffer for returning the shortcode markup;
 * 
 * Sample Shortcode
 * 
 * @todo Change the `prefix_` and with your own unique prefix.
 * 
 * @since 1.0.0
 */
if( ! function_exists( 'prefix_add_sample_shortcode' ) ) :
	function prefix_add_sample_shortcode() {

		ob_start();
		?>
		<h2>Hello World</h2>
		<p>Content Goes Here..</p>
		<p>Some More..</p>
		<p>And More..</p>
		<?php
		return ob_get_clean();

   	}
   	add_shortcode( 'prefix_sample_shortcode', 'prefix_add_sample_shortcode' );
endif;