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.<br>
- 'categories'
(array) Associative array of add-on category information, mapping ID to Title.<br> - 'items'
(array[]) List of add-ons definition arrays.<br>
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;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.22.0 | Introduced. |