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::cascade_visibility_attrs( array[] $blocks, string|null $visibility = null )

Cascade all llms_visibility attributes down into inner blocks.


Description Description

If a parent block has a visibility setting this will apply that visibility to a chlid block if the child block does not have a visibility setting of its own.

Ultimately this ensures that a field block that’s not visible can be marked as "optional" so that form validation can take place.

For example, if a columns block is displayed only to logged out users and it’s child fields are marked as required that means that it’s required only to logged out users and the field becomes "optional" (for validation purposes) to logged in users.


Parameters Parameters

$blocks

(Required) Array of parsed block arrays.

$visibility

(Optional) The llms_visibility attribute of the parent block which is applied to all innerBlocks if the innerBlock does not already have it's own visibility attribute.

Default value: null


Top ↑

Return Return

(array[])


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.