LLMS_Shortcodes::shortcode_wrapper( $function,  $atts = array(),  $wrapper = array('class' => 'lifterlms', 'before' => null, 'after' => null) )

Creates a wrapper for shortcode.


Return Return

(string)


Top ↑

Source Source

File: includes/shortcodes/class.llms.shortcodes.php

	 */
	public static function shortcode_wrapper(
		$function,
		$atts = array(),
		$wrapper = array(
			'class'  => 'lifterlms',
			'before' => null,
			'after'  => null,
		) ) {

			ob_start();

			$before = empty( $wrapper['before'] ) ? '<div class="' . esc_attr( $wrapper['class'] ) . '">' : $wrapper['before'];
			$after  = empty( $wrapper['after'] ) ? '</div>' : $wrapper['after'];

			echo $before;
			call_user_func( $function, $atts );
			echo $after;

			return ob_get_clean();


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.