Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
firepot
/
wp-content
/
plugins
/
cyarb-toolkit
/
widgets
:
security-area.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php /** * Check Security Area Widget */ namespace Elementor; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } class Cyarb_Ser_Security_Area extends Widget_Base { public function get_name() { return 'Security_Area '; } public function get_title() { return esc_html__( 'Security Area ', 'cyarb-toolkit' ); } public function get_icon() { return 'eicon-table-of-contents'; } public function get_categories() { return [ 'cyarb-elements' ]; } protected function register_controls() { $this->start_controls_section( 'Cyarb_Security_Area ', [ 'label' => esc_html__( 'Cyarb Security Area ', 'cyarb-toolkit' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'top_title', [ 'label' => esc_html__( 'Top Title', 'cyarb-toolkit' ), 'type'=>Controls_Manager:: TEXT, ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Title', 'cyarb-toolkit' ), 'type'=>Controls_Manager:: TEXT, ] ); $this->add_control( 'title_tag', [ 'label' => esc_html__( 'Title Tag', 'cyarb-toolkit' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => esc_html__( 'h1', 'cyarb-toolkit' ), 'h2' => esc_html__( 'h2', 'cyarb-toolkit' ), 'h3' => esc_html__( 'h3', 'cyarb-toolkit' ), 'h4' => esc_html__( 'h4', 'cyarb-toolkit' ), 'h5' => esc_html__( 'h5', 'cyarb-toolkit' ), 'h6' => esc_html__( 'h6', 'cyarb-toolkit' ), ], 'default' => 'h1', ] ); $this->add_control( 'shortcode', [ 'label' => esc_html__( 'Contact Shortcode', 'cyarb-toolkit' ), 'type' => Controls_Manager::TEXT, ] ); //Shape Images $this->add_control( 'image_shape', [ 'label' => esc_html__( 'Hide Shapes?', 'cyarb-toolkit' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'cyarb-toolkit' ), 'label_off' => esc_html__( 'Hide', 'cyarb-toolkit' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style', [ 'label' => esc_html__( 'Style', 'cyarb-toolkit' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'top_title_color', [ 'label' => esc_html__( 'Top Title Color', 'cyarb-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .security-title-content .sub-title' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'top_title_typography', 'label' => __( 'Top Title Typography', 'cyarb-toolkit' ), 'selector' => '{{WRAPPER}} .security-title-content .sub-title', ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Title Color', 'cyarb-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .security-title-content h1, .security-title-content h2, .security-title-content h3, .security-title-content h4, .security-title-content h5, .security-title-content h6' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => __( 'Title Typography', 'cyarb-toolkit' ), 'selector' => '{{WRAPPER}} .security-title-content h1, .security-title-content h2, .security-title-content h3, .security-title-content h4, .security-title-content h5, .security-title-content h6', ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); ?> <div class="security-area"> <div class="container"> <div class="security-title-content"> <span class="sub-title"><?php echo esc_html( $settings['top_title'] ); ?></span> <<?php echo esc_attr( $settings['title_tag'] ); ?>><?php echo esc_html( $settings['title'] ); ?></<?php echo esc_attr( $settings['title_tag'] ); ?>> <div class="contact-form"> <?php echo do_shortcode( $settings['shortcode'] ); ?> </div> </div> </div> <?php if ( 'yes' === $settings['image_shape'] ) : ?> <div class="shape1"><img src="<?php echo esc_url(get_template_directory_uri() .'/assets/img/shape/shape1.png' ); ?>" alt="<?php echo esc_attr__( 'Shape', 'cyarb-toolkit' ); ?>"></div> <div class="shape4"><img src="<?php echo esc_url(get_template_directory_uri() .'/assets/img/shape/shape4.png' ); ?>" alt="<?php echo esc_attr__( 'Shape', 'cyarb-toolkit' ); ?>"></div> <div class="shape5"><img src="<?php echo esc_url(get_template_directory_uri() .'/assets/img/shape/shape5.png' ); ?>" alt="<?php echo esc_attr__( 'Shape', 'cyarb-toolkit' ); ?>"></div> <?php endif; ?> </div> <?php } } Plugin::instance()->widgets_manager->register_widget_type( new Cyarb_Ser_Security_Area );