Astra_Builder_Helper::render_builder_markup( string $row = 'primary', string $column = 'left', string $header = 'desktop', string $builder = 'header' )

Adds support to render header columns.


Description


Parameters

$row

(string) (Optional) the name of the row.

Default value: 'primary'

$column

(string) (Optional) the name of the column.

Default value: 'left'

$header

(string) (Optional) the name of the header.

Default value: 'desktop'

$builder

(string) (Optional) the name of the builder.

Default value: 'header'


Source

File: inc/core/builder/class-astra-builder-helper.php

	public static function render_builder_markup( $row = 'primary', $column = 'left', $header = 'desktop', $builder = 'header' ) {
		$elements = astra_get_option( $builder . '-' . $header . '-items' );
		if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_' . $column ] ) && is_array( $elements[ $row ][ $row . '_' . $column ] ) && ! empty( $elements[ $row ][ $row . '_' . $column ] ) ) {
			foreach ( $elements[ $row ][ $row . '_' . $column ] as $key => $item ) {


				if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {

					get_template_part(
						'template-parts/' . $builder . '/builder/components',
						'',
						array(
							'type'   => $item,
							'device' => $header,
						)
					);
				} else {

					set_query_var( 'type', $item );
					get_template_part( 'template-parts/' . $builder . '/builder/components' );
				}
			}
		}
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.