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.

Top ↑

Parameters Parameters


(string) (Required) Key found within the add-on item. EG: "id" or "update_file".


(string) (Required) Value of the key to match.

Top ↑

Return Return

(array|false) Returns the add-on data array of false if no found.

Top ↑

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;


Top ↑

Changelog Changelog

Version Description
4.21.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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