llms_get_add_ons( $use_cache = true )

Retrieve available products from the LifterLMS.com API


Return Return

(array) Array of LifterLMS add-on data from the LifterLMS.com products api.

  • 'categories'
    (array) Associative array of add-on category information, mapping ID to Title.
  • 'items'
    (array[]) List of add-ons definition arrays.


Top ↑

Source Source

File: includes/admin/llms.functions.admin.php

function llms_get_add_ons( $use_cache = true ) {

	$data = $use_cache ? get_transient( 'llms_products_api_result' ) : false;

	if ( false === $data ) {

		$req  = new LLMS_Dot_Com_API( '/products', array(), 'GET' );
		$data = $req->get_result();

		if ( $req->is_error() ) {
			return $data;
		}

		set_transient( 'llms_products_api_result', $data, DAY_IN_SECONDS );

	}

	return $data;

}


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.