WC_Shortcodes::product_category
List products in a category shortcode.
Метод класса: WC_Shortcodes{}
Хуков нет.
Возвращает
Строку.
Использование
$result = WC_Shortcodes::product_category( $atts );
- $atts(массив) (обязательный)
- Attributes.
Код WC_Shortcodes::product_category() WC Shortcodes::product category WC 10.7.0
public static function product_category( $atts ) {
if ( empty( $atts['category'] ) ) {
return '';
}
$atts = array_merge(
array(
'limit' => '12',
'columns' => '4',
'orderby' => 'menu_order title',
'order' => 'ASC',
'category' => '',
'cat_operator' => 'IN',
),
(array) $atts
);
$shortcode = new WC_Shortcode_Products( $atts, 'product_category' );
return $shortcode->get_content();
}