WC_Shortcodes::product_category()
List products in a category shortcode.
Method of the class: WC_Shortcodes{}
No Hooks.
Return
String
.
Usage
$result = WC_Shortcodes::product_category( $atts );
- $atts(array) (required)
- Attributes.
WC_Shortcodes::product_category() WC Shortcodes::product category code WC 9.7.1
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(); }