WooCommerce – Get featured products IDs

And another great snippet that i coded today. It’s a function that creates an array of featured products IDs. That’s pretty useful if for example you want to quickly get only featured products IDs, or doing a condition (if has featured product then do that…). The function store all featured products IDs within a transient to avoid unwanted connections to the database. Simply place that code within your functions.php file:

About the author

Remi Hey! My name is Rémi Corson, I'm a French WordPress Developer, I code stuff and I write from time to time ;-) Buy a coffee
Show your support

Related Posts


Leave a Reply