WC_Shortcodes::product
Display a single product.
Method of the class: WC_Shortcodes{}
No Hooks.
Returns
String.
Usage
$result = WC_Shortcodes::product( $atts );
- $atts(array) (required)
- Attributes.
WC_Shortcodes::product() WC Shortcodes::product code WC 10.4.3
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();
}