OwlCyberSecurity - MANAGER
Edit File: search-popup.php
<?php use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Utils; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Border; use Elementor\Group_Control_Box_Shadow; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Chursy_Elementor_Ova_Search_Popup extends Widget_Base { public function get_name() { return 'chursy_elementor_ova_search_popup'; } public function get_title() { return esc_html__( 'Search Popup', 'chursy' ); } public function get_icon() { return 'eicon-search'; } public function get_categories() { return [ 'hf' ]; } public function get_script_depends() { return [ 'chursy-elementor-search-popup' ]; } protected function register_controls() { $this->start_controls_section( 'section_icon_search', [ 'label' => esc_html__( 'Icon Search', 'chursy' ), ] ); $this->add_control( 'size_icon', [ 'label' => esc_html__( 'Size Icon', 'chursy' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .ova_wrap_search_popup i' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'color_icon_search', [ 'label' => esc_html__( 'Icon Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova_wrap_search_popup i' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'color_hover_icon_search', [ 'label' => esc_html__( 'Icon Color Hover', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova_wrap_search_popup i:hover' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'border_icon_search', 'selector' => '{{WRAPPER}} .ova_wrap_search_popup > i', ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow_icon_search', 'selector' => '{{WRAPPER}} .ova_wrap_search_popup > i', ] ); $this->add_control( 'padding_icon_search', [ 'label' => esc_html__( 'Padding', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}} .ova_wrap_search_popup > i' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'border_radius_icon_search', [ 'label' => esc_html__( 'Border Radius', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}} .ova_wrap_search_popup > i' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_search_popup_button', [ 'label' => esc_html__( 'Search Popup Button', 'chursy' ), ] ); $this->add_control( 'bgcolor_search_popup_button', [ 'label' => esc_html__( 'Background Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova_wrap_search_popup .ova_search_popup .container .search-form .search-submit' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'bgcolor_hover_icon_search_popup', [ 'label' => esc_html__( 'Background Color Hover', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova_wrap_search_popup .ova_search_popup .container .search-form .search-submit:hover' => 'background-color: {{VALUE}}', ], ] ); $this->end_controls_section(); } protected function render() { ?> <div class="ova_wrap_search_popup"> <i class="ovaicon ovaicon-search"></i> <div class="ova_search_popup"> <div class="search-popup__overlay"></div> <div class="container"> <form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>"> <input type="search" class="search-field" placeholder="<?php esc_attr_e( 'Search …', 'chursy' ) ?>" value="<?php echo get_search_query() ?>" name="s" title="<?php esc_attr_e( 'Search for:', 'chursy' ) ?>" /> <button type="submit" class="search-submit" aria-label="<?php esc_attr_e( 'Search', 'chursy' ) ?>"> <i class="ovaicon ovaicon-search"></i> </button> </form> </div> </div> </div> <?php } } $widgets_manager->register( new Chursy_Elementor_Ova_Search_Popup() );