WordPress at a glance
function is not described

wc_get_featured_product_ids() WC 2.1

Function that returns an array containing the IDs of the featured products.

No Hooks.

Return

Array.

Usage

wc_get_featured_product_ids();

Changelog

Since 2.1 Introduced.

Code of wc_get_featured_product_ids() WC 5.0.0

<?php
function wc_get_featured_product_ids() {
	// Load from cache.
	$featured_product_ids = get_transient( 'wc_featured_products' );

	// Valid cache found.
	if ( false !== $featured_product_ids ) {
		return $featured_product_ids;
	}

	$data_store           = WC_Data_Store::load( 'product' );
	$featured             = $data_store->get_featured_product_ids();
	$product_ids          = array_keys( $featured );
	$parent_ids           = array_values( array_filter( $featured ) );
	$featured_product_ids = array_unique( array_merge( $product_ids, $parent_ids ) );

	set_transient( 'wc_featured_products', $featured_product_ids, DAY_IN_SECONDS * 30 );

	return $featured_product_ids;
}