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::is_block_visible( array $block )
Determine if a block is visible based on LifterLMS Visibility Settings.
Parameters Parameters
- $block
-
(array) (Required) Parsed block array.
Return Return
(bool)
Source Source
File: includes/forms/class-llms-forms.php
901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 | * @param array $block Parsed block array . * @ return bool */ private function is_block_visible( $block ) { // Make the block return a non empty string if it's visible, it will already automatically return an empty string if it's invisible. add_filter( 'render_block' , array ( __CLASS__ , '__return_string' ), 5 ); // Don't run this class render function on the block during this test. remove_filter( 'render_block' , array ( $this , 'render_field_block' ), 10, 2 ); // Render the block. $render = render_block( $block ); // Cleanup / reapply filters. add_filter( 'render_block' , array ( $this , 'render_field_block' ), 10, 2 ); remove_filter( 'render_block' , array ( __CLASS__ , '__return_string' ), 5 ); /** * Filter whether or not the block is visible. * * @since 5.0.0 * * @param bool $visible Whether or not the block is visible. * @param array $block Parsed block array. */ |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |