WC_Shortcodes::sale_products()public staticWC 1.0

List all products on sale.

Метод класса: WC_Shortcodes{}

Хуков нет.

Возвращает

Строку.

Использование

$result = WC_Shortcodes::sale_products( $atts );
$atts(массив) (обязательный)
Attributes.

Код WC_Shortcodes::sale_products() WC 8.7.0

public static function sale_products( $atts ) {
	$atts = array_merge(
		array(
			'limit'        => '12',
			'columns'      => '4',
			'orderby'      => 'title',
			'order'        => 'ASC',
			'category'     => '',
			'cat_operator' => 'IN',
		),
		(array) $atts
	);

	$shortcode = new WC_Shortcode_Products( $atts, 'sale_products' );

	return $shortcode->get_content();
}