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_Forms_Data::has_username_block( array[] $blocks )

Locate a username/user login block within a list of blocks


Description Description

Checks into innerBlocks recursively.


Top ↑

Parameters Parameters

$blocks

(array[]) (Required) Array of WP_Block definition arrays.


Top ↑

Return Return

(boolean) Returns true when a username block is found, otherwise returns false.


Top ↑

Source Source

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

	private function has_username_block( $blocks ) {

		foreach ( $blocks as $block ) {

			if ( 'llms/form-field-user-login' === $block['blockName'] ) {
				return true;
			} elseif ( $block['innerBlocks'] ) {
				if ( $this->has_username_block( $block['innerBlocks'] ) ) {
					return true;
				}
			}
		}

		return false;

	}


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.