WC_Shortcodes::product( array $atts )
Display a single product.
Description Description
Parameters Parameters
- $atts
-
(Required) Attributes.
Return Return
(string)
Source Source
File: includes/class-wc-shortcodes.php
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();
}