LLMS_Admin_AddOns::get_product_from_cat( string $cat, array $excludes )
Get a random product from a category that doesn’t exist in the list of excluded product ids
Parameters Parameters
- $cat
-
(string) (Required) category slug
- $excludes
-
(array) (Required) list of product ids to exclude
Return Return
(array|false)
Source Source
File: includes/admin/class.llms.admin.addons.php
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | $cats = array ( 'e-commerce' , 'bundles' , 'resources' , 'courses' , 'courses' , ); foreach ( $cats as $cat ) { $addon = $this ->get_product_from_cat( $cat , $exclude ); if ( $addon ) { $features [] = $addon ; $exclude [] = $addon [ 'id' ]; } if ( 3 === count ( $features ) ) { return $features ; } } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.22.0 | Introduced. |