WordPress at Your Fingertips
function is not described

WC_Shortcodes::product() public WC 1.0

Display a single product.

{} It's a method of the class: WC_Shortcodes{}

No Hooks.

Return

String.

Usage

$result = WC_Shortcodes::product( $atts );
$atts(array) (required)
Attributes.

Code of WC_Shortcodes::product() WC 5.9.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();
}