';
do_action( 'storefront_homepage_after_best_selling_products_title' );
echo $shortcode_content; // WPCS: XSS ok.
do_action( 'storefront_homepage_after_best_selling_products' );
echo '';
}
}
}
if ( ! function_exists( 'storefront_promoted_products' ) ) {
/**
* Featured and On-Sale Products
* Check for featured products then on-sale products and use the appropiate shortcode.
* If neither exist, it can fallback to show recently added products.
*
* @since 1.5.1
* @param integer $per_page total products to display.
* @param integer $columns columns to arrange products in to.
* @param boolean $recent_fallback Should the function display recent products as a fallback when there are no featured or on-sale products?.
* @uses storefront_is_woocommerce_activated()
* @uses wc_get_featured_product_ids()
* @uses wc_get_product_ids_on_sale()
* @uses storefront_do_shortcode()
* @return void
*/
function storefront_promoted_products( $per_page = '2', $columns = '2', $recent_fallback = true ) {
if ( storefront_is_woocommerce_activated() ) {
if ( wc_get_featured_product_ids() ) {
echo '