LLMS_Forms::get_field_by( array[] $fields, string $key, mixed $val, string $return = 'field' )

Retrieve a field item from a list of fields by a key/value pair.


Description Description


Parameters Parameters

$fields

(Required) List of LifterLMS Form Fields.

$key

(Required) Setting key to search for.

$val

(Required) Setting valued to search for.

$return

(Optional) Determine the return value. Use "field" to return the field settings array. Use "index" to return the index of the field in the $fields array.

Default value: 'field'


Top ↑

Return Return

(array|int|false) false when the field isn't found in $fields, otherwise returns the field settings as an array when $return is "field". Otherwise returns the field's index as an int.


Top ↑

Source Source

File: includes/forms/class-llms-forms.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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