WC_Shortcodes::shortcode_wrapper
Shortcode Wrapper.
Метод класса: WC_Shortcodes{}
Хуков нет.
Возвращает
Строку.
Использование
$result = WC_Shortcodes::shortcode_wrapper( $function, $atts, $wrapper, foooo, fooooo, ) );
- $function(string[]) (обязательный)
- Callback function.
- $atts(массив)
- Attributes.
По умолчанию:empty array - $wrapper(массив)
- Customer wrapper data.
По умолчанию:array( foo - foooo
- .
По умолчанию:> null - fooooo
- .
По умолчанию:> null - )(обязательный)
- .
Код WC_Shortcodes::shortcode_wrapper() WC Shortcodes::shortcode wrapper 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();
}