/** * Display popular products * * @param int $num_posts number of products to display * * @since 1.0.0 */ function wcmvp_display_most_viewed_products($num_posts = 10) { $content = wcmvp_render_most_viewed_products($num_posts); echo $content; }
/** * Shortcode * * @param $atts attributes * * @return string rendered products output * * @since 1.0.0 */ function wcmvp_most_viewed_products_shortcode($atts) { $atts = shortcode_atts(array('product_count' => '10'), $atts); $content = wcmvp_render_most_viewed_products($atts['product_count']); return $content; }