OwlCyberSecurity - MANAGER
Edit File: box-mail.php
<?php use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use Elementor\Utils; use Elementor\Group_Control_Border; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly class Chursy_Elementor_Box_Mail extends Widget_Base { public function get_name() { return 'chursy_elementor_box_mail'; } public function get_title() { return esc_html__( 'Box Mail', 'chursy' ); } public function get_icon() { return 'eicon-mailchimp'; } public function get_categories() { return [ 'chursy' ]; } public function get_script_depends() { return [ '' ]; } // Add Your Controll In This Function protected function register_controls() { $this->start_controls_section( 'section_content', [ 'label' => esc_html__( 'Content', 'chursy' ), ] ); $this->add_control( 'text', [ 'label' => esc_html__( 'Text', 'chursy' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Newsletter', 'chursy' ), ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Title', 'chursy' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Subscribe to church', 'chursy' ), ] ); $this->add_control( 'short_desc', [ 'label' => esc_html__( 'Description', 'chursy' ), 'type' => Controls_Manager::TEXTAREA, 'default' => esc_html__( 'A simple short and brief information/description about this particular title goes in here. ', 'chursy' ), ] ); $this->add_control( 'shortcode', [ 'label' => esc_html__( 'Enter your shortcode', 'chursy' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => '[gallery id="123" size="medium"]', 'default' => '', ] ); $this->end_controls_section(); /* General */ $this->start_controls_section( 'items_style_section', [ 'label' => esc_html__( 'General', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'items_max_width', [ 'label' => esc_html__( 'Max Width', 'chursy' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 250, 'max' => 1290, 'step' => 1, ], '%' => [ 'min' => 20, 'max' => 100, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .ova-box-mail' => 'max-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'items_padding', [ 'label' => esc_html__( 'Padding', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .ova-box-mail .item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'items_box_shadow', 'selector' => '{{WRAPPER}} .ova-box-mail .item', ] ); $this->add_control( 'items_bg', [ 'label' => esc_html__( 'Background', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-box-mail .item' => 'background: {{VALUE}}', ], ] ); $this->end_controls_section(); /* Text */ $this->start_controls_section( 'section_text', [ 'label' => esc_html__( 'Text', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'text_typography', 'selector' => '{{WRAPPER}} .ova-box-mail .item .text', ] ); $this->add_control( 'color_text', [ 'label' => esc_html__( 'Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-box-mail .item .text' => 'color : {{VALUE}};', ], ] ); $this->add_responsive_control( 'margin_text', [ 'label' => esc_html__( 'Margin', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-box-mail .item .text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); //SECTION TAB STYLE TITLE $this->start_controls_section( 'section_title', [ 'label' => esc_html__( 'Title', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .ova-box-mail .title', ] ); $this->add_control( 'color_title', [ 'label' => esc_html__( 'Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-box-mail .title' => 'color : {{VALUE}};', ], ] ); $this->add_responsive_control( 'margin_title', [ 'label' => esc_html__( 'Margin', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-box-mail .title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); //END SECTION TAB STYLE TITLE /* Short Description */ $this->start_controls_section( 'section_short_desc', [ 'label' => esc_html__( 'Short Description', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'short_desc_typography', 'selector' => '{{WRAPPER}} .ova-box-mail .short_desc', ] ); $this->add_control( 'color_short_desc', [ 'label' => esc_html__( 'Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-box-mail .short_desc', ], ] ); $this->add_responsive_control( 'margin_short_desc', [ 'label' => esc_html__( 'Margin', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-box-mail .short_desc' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); } // Render Template Here protected function render() { $settings = $this->get_settings_for_display(); $text = $settings['text']; $title = $settings['title']; $short_desc = $settings['short_desc']; $shortcode = $settings['shortcode']; $shortcode = do_shortcode(shortcode_unautop($shortcode)); ?> <div class="ova-box-mail"> <div class="item"> <div class="info"> <?php if( !empty($text) ) { ?> <span class="text"> <?php echo esc_html( $text ); ?> </span> <?php } ?> <?php if( !empty($title) ) { ?> <h2 class="title"> <?php echo esc_html($title); ?> </h2> <?php } ?> <?php if ( !empty($short_desc) ) { ?> <div class="short_desc"> <?php echo esc_html($short_desc); ?> </div> <?php } ?> <div class="shortcode"> <?php echo do_shortcode(shortcode_unautop($shortcode)); ?> </div> </div> </div> </div> <?php } } $widgets_manager->register( new Chursy_Elementor_Box_Mail() );