OwlCyberSecurity - MANAGER
Edit File: call_to_action.php
<?php namespace CONATPLUGIN\Element; use Elementor\Controls_Manager; use Elementor\Controls_Stack; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Border; use Elementor\Repeater; use Elementor\Widget_Base; use Elementor\Utils; use Elementor\Group_Control_Text_Shadow; use Elementor\Group_Control_Box_Shadow; use Elementor\Group_Control_Background; use Elementor\Group_Control_Image_Size; use Elementor\Plugin; class Call_To_Action extends Widget_Base { public function get_name() { return 'conat_call_to_action'; } public function get_title() { return esc_html__( 'Conat Call to Action', 'conat' ); } public function get_icon() { return 'tr-custom-icon'; } public function get_categories() { return [ 'conat' ]; } protected function _register_controls() { //Images $this->start_controls_section( 'image_tab', [ 'label' => esc_html__( 'Images', 'conat' ), ] ); $this->add_control( 'bg_image', [ 'label' => __( 'Background Image', 'conat' ), 'type' => Controls_Manager::MEDIA, 'default' => ['url' => Utils::get_placeholder_image_src(),], ] ); $this->end_controls_section(); //Content $this->start_controls_section( 'content_tab', [ 'label' => esc_html__( 'Content', 'conat' ), ] ); $this->add_control( 'subtitle', [ 'label' => __( 'Sub Title', 'conat' ), 'type' => Controls_Manager::TEXT, ] ); $this->add_control( 'title', [ 'label' => __( 'Title', 'conat' ), 'type' => Controls_Manager::TEXTAREA, ] ); $this->end_controls_section(); //Button $this->start_controls_section( 'button_tab', [ 'label' => esc_html__( 'Button', 'conat' ), ] ); $this->add_control( 'btn_style', [ 'label' => esc_html__('Style', 'conat'), 'type' => Controls_Manager::SELECT2, 'default' => 'one', 'options' => conat_button_style(), ] ); $this->add_control( 'btn_name', [ 'label' => __( 'Name', 'conat' ), 'type' => Controls_Manager::TEXT, ] ); $this->add_control( 'btn_link', [ 'label' => __( 'Link', 'conat' ), 'type' => Controls_Manager::URL, 'placeholder' => __( 'https://your-link.com', 'conat' ), 'show_external' => true, 'dynamic' => [ 'active' => true, ], 'default' => [ 'url' => '#', ], ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $allowed_tags = wp_kses_allowed_html('post'); ?> <!-- Call To Action Section One --> <section class="call-to-action-section-one" <?php if($settings['bg_image']['id']) { ?>style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['bg_image']['id'])); ?>)"<?php } ?>> <div class="auto-container"> <div class="title"><?php echo wp_kses( $settings['subtitle'], true ); ?></div> <h2><?php echo wp_kses( $settings['title'], true ); ?></h2> <?php if($settings['btn_link']['url'] and $settings['btn_name']) { echo conat_button('one', $settings['btn_name'], $settings['btn_link']['url']); } ?> </div> </section> <!-- End Call To Action Section One --> <?php } }