LLMS_Add_On::__construct( array $addon = array(), string $lookup_key = 'id' )
Constructor
Description Description
Parameters Parameters
- $addon
-
(array) (Optional) array of addon data
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'
Return Return
(void)
Source Source
File: includes/models/model.llms.add-on.php
public function __construct( $addon = array(), $lookup_key = 'id' ) { if ( is_string( $addon ) ) { $lookup_val = $addon; $addons = llms_get_add_ons(); if ( ! empty( $addons['items'] ) ) { foreach ( $addons['items'] as $addon ) { if ( isset( $addon[ $lookup_key ] ) && $addon[ $lookup_key ] == $lookup_val ) { $this->data = $addon; break; } } } } $this->data = $addon; $this->id = $addon['id']; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.22.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: