Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Admin_AddOns::get_products_for_cat( string $cat,  $include_bundles = true )

Retrieve products for a specific category


Parameters Parameters

$cat

(string) (Required) category slug


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/admin/class.llms.admin.addons.php

	 *
	 * @param  string $cat      Category slug.
	 * @param  array  $excludes List of product ids to exclude.
	 * @return array|false
	 */
	public function get_product_from_cat( $cat, $excludes ) {

		$addons = $this->get_products_for_cat( $cat, true );
		shuffle( $addons );

		foreach ( $addons as $addon ) {

			if ( in_array( 'third-party', array_keys( $addon['categories'] ), true ) ) {
				continue;
			}

			if ( ! in_array( $addon['id'], $excludes, true ) ) {
				return $addon;
			}
		}



Top ↑

Changelog Changelog

Changelog
Version Description
3.22.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.