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.


Parameters Parameters

$fields

(array[]) (Required) List of LifterLMS Form Fields.

$key

(string) (Required) Setting key to search for.

$val

(mixed) (Required) Setting valued to search for.

$return

(string) (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

	 *
	 * @since 5.0.0
	 *
	 * @param string $location Form location, one of: "checkout", "registration", or "account".
	 * @param array  $args     Additional arguments passed to the short-circuit filter in `get_form_post()`.
	 * @return string
	 */
	public function get_form_html( $location, $args = array() ) {

		$blocks = $this->get_form_blocks( $location, $args );
		if ( ! $blocks ) {

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.