WC_Shortcodes::shortcode_wrapperpublic staticWC 1.0

Shortcode Wrapper.

Method of the class: WC_Shortcodes{}

No Hooks.

Returns

String.

Usage

$result = WC_Shortcodes::shortcode_wrapper( $function, $atts, $wrapper, foooo, fooooo, ) );
$function(string[]) (required)
Callback function.
$atts(array)
Attributes.
Default: empty array
$wrapper(array)
Customer wrapper data.
Default: array( foo
foooo
.
Default: > null
fooooo
.
Default: > null
)(required)
.

WC_Shortcodes::shortcode_wrapper() code WC 10.7.0

public static function shortcode_wrapper(
	$function,
	$atts = array(),
	$wrapper = array(
		'class'  => 'woocommerce',
		'before' => null,
		'after'  => null,
	)
) {
	ob_start();

	// @codingStandardsIgnoreStart
	echo empty( $wrapper['before'] ) ? '<div class="' . esc_attr( $wrapper['class'] ) . '">' : $wrapper['before'];
	call_user_func( $function, $atts );
	echo empty( $wrapper['after'] ) ? '</div>' : $wrapper['after'];
	// @codingStandardsIgnoreEnd

	return ob_get_clean();
}