render_icon_element( $this->attribute['sg_search_icon'] ); $type = $this->attribute['sg_search_style']; if ( 'popup' === $type ) { $output = $this->render_modal( $icon ); } else { $output = $this->render_form( $icon ); } return $this->render_wrapper( 'search', $output ); } /** * Render Modal * * @param string $icon Rendered icon. */ private function render_modal( $icon ) { $search_modal_class = 'jkit-search-modal'; if ( 'gradient' === $this->attribute['st_icon_normal_background_background_background'] || 'gradient' === $this->attribute['st_icon_hover_background_background_background'] ) { $search_modal_class .= ' hover-gradient'; } return '' . $icon . '
' . $this->render_form( $icon ) . '
'; } /** * Render Form * * @param string $icon Rendered icon. */ private function render_form( $icon ) { $language_prefix = function_exists( 'pll_current_language' ) ? pll_current_language() : ''; $placeholder = esc_attr( $this->attribute['sg_search_placeholder'] ); $button_icon = 'icon' === $this->attribute['sg_search_button_style'] ? $icon : esc_attr( $this->attribute['sg_search_text'] ); $button_class = 'jkit-search-button'; $input_class = 'jkit-search-field'; if ( 'gradient' === $this->attribute['st_button_background_background_background'] || 'gradient' === $this->attribute['st_button_hover_background_background_background'] ) { $button_class .= ' hover-gradient'; } return '
'; } }