Elementor_Helpers::get_all_inner_forms( $elements )


Source Source

File: src/integrations/elementor/helpers/elementor-helpers.php

	public static function get_all_inner_forms( $elements ) {
		$block_is_on_page = array();
		if ( ! empty( $elements ) ) {
			foreach ( $elements as $element ) {
				if ( 'widget' === $element->elType && 'form' === $element->widgetType ) {
					$block_is_on_page[] = $element;
				}
				if ( ! empty( $element->elements ) ) {
					$inner_block_is_on_page = self::get_all_inner_forms( $element->elements );
					if ( ! empty( $inner_block_is_on_page ) ) {
						$block_is_on_page = array_merge( $block_is_on_page, $inner_block_is_on_page );
					}
				}
			}
		}

		return $block_is_on_page;
	}