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_Add_On::lookup_add_on( string $lookup_key, string $lookup_val )
Locate an add-on by a key/val pair
Description Description
Loads add-ons via llms_get_add_ons()
and loops through the items list to find an addon specified by the key/val pair.
Parameters Parameters
- $lookup_key
-
(string) (Required) Key found within the add-on item. EG: "id" or "update_file".
- $lookup_val
-
(string) (Required) Value of the key to match.
Return Return
(array|false) Returns the add-on data array of false
if no found.
Source Source
File: includes/models/model.llms.add-on.php
private function lookup_add_on( $lookup_key, $lookup_val ) { $addons = llms_get_add_ons(); // Error communicating with the API or no items found. if ( is_wp_error( $addons ) || empty( $addons['items'] ) ) { return false; } // Loop through the list. foreach ( $addons['items'] as $addon ) { // We've found a match. if ( isset( $addon[ $lookup_key ] ) && $addon[ $lookup_key ] === $lookup_val ) { return $addon; } } return false; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
4.21.3 | Introduced. |