Astra_Ext_Adv_Search_Markup::get_search_markup( string $search_markup, string $option = '', string $device = '' )

Adding Wrapper for Search Form.


Description


Parameters

$search_markup

(string) (Required) Search Form Content.

$option

(string) (Optional) Search Form Options.

Default value: ''

$device

(string) (Optional) Device in which used.

Default value: ''


Return

(Search) HTML structure created.


Source

File: addons/advanced-search/classes/class-astra-ext-adv-search-markup.php

		public function get_search_markup( $search_markup, $option = '', $device = '' ) {

			if ( true === astra_addon_builder_helper()->is_header_footer_builder_active ) {

				$search_box_style = astra_get_option( 'header-search-box-type', 'slide-search' );
				$search_box_style = apply_filters( 'astra_search_style_hs', $search_box_style );
				$elements         = astra_get_option( 'header-mobile-items' );
				$search_in_popup  = false;

				if ( is_array( $elements ) && is_array( $elements['popup']['popup_content'] ) && in_array( 'search', $elements['popup']['popup_content'], true ) ) {
					$search_in_popup = true;
				}

				if ( 'search-box' == $search_box_style || ( $search_in_popup && 'mobile' === $device ) ) {

					$search_markup = $this->get_search_form( 'search-box' );
				} elseif ( ( 'header-cover' == $search_box_style || 'full-screen' == $search_box_style ) && ! ( $search_in_popup && 'mobile' === $device ) ) {

					$search_markup  = $this->get_search_icon( $search_box_style );
					$search_markup .= '<div class="ast-search-menu-icon ' . $search_box_style . '">';
					$search_markup .= '</div>';
				}
			} else {

				$search_box_style = astra_get_option( $option . '-search-box-type', 'slide-search' );
				$option_slug      = str_replace( '-', '_', $option );
				$search_box_style = apply_filters( 'astra_search_style_' . $option_slug, $search_box_style );

				if ( 'search-box' == $search_box_style ) {
					$search_markup = $this->get_search_form( 'search-box' );
				} elseif ( 'header-cover' == $search_box_style || 'full-screen' == $search_box_style ) {

					$search_markup = $this->get_search_icon( $search_box_style );
					if ( false == astra_get_option( 'header-display-outside-menu' ) && 'header-main-rt-section' === $option ) {
						$search_markup .= '<div class="ast-search-menu-icon ' . $search_box_style . '">';
						$search_markup .= '</div>';
					}
				}
			}

			return $search_markup;
		}

Changelog

Changelog
Version Description
1.4.8 Introduced.


User Contributed Notes

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