WC_Shortcodes::product
Display a single product.
Метод класса: WC_Shortcodes{}
Хуков нет.
Возвращает
Строку.
Использование
$result = WC_Shortcodes::product( $atts );
- $atts(массив) (обязательный)
- Attributes.
Код WC_Shortcodes::product() WC Shortcodes::product WC 10.7.0
public static function product( $atts ) {
if ( empty( $atts ) ) {
return '';
}
$atts['skus'] = isset( $atts['sku'] ) ? $atts['sku'] : '';
$atts['ids'] = isset( $atts['id'] ) ? $atts['id'] : '';
$atts['limit'] = '1';
$shortcode = new WC_Shortcode_Products( (array) $atts, 'product' );
return $shortcode->get_content();
}