LLMS_Add_On::__construct( string|array $addon = array(), string $lookup_key = 'id' )

Constructor


Parameters Parameters

$addon

(string|array) (Optional) Add-on data array or a string (such as an ID or update file path) used to lookup the addon.

Default value: array()

$lookup_key

(string) (Optional) If $addon is a string, this determines how to lookup the addon from the available list of addons.

Default value: 'id'


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/models/model.llms.add-on.php

	public function __construct( $addon = array(), $lookup_key = 'id' ) {

		if ( is_string( $addon ) ) {
			$addon = $this->lookup_add_on( $lookup_key, $addon );
		}

		$this->id   = ! empty( $addon['id'] ) ? $addon['id'] : '';
		$this->data = $addon ? $addon : array();

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.21.3 Move lookup logic to its own private method: lookup_add_on().
3.22.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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