OwlCyberSecurity - MANAGER
Edit File: our-team.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_Our_Team extends Widget_Base { public function get_name() { return 'chursy_elementor_our_team'; } public function get_title() { return esc_html__( 'Our Team', 'chursy' ); } public function get_icon() { return 'eicon-person'; } 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( 'content_section', [ 'label' => esc_html__( 'Content', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'image', [ 'label' => esc_html__( 'Choose Image', 'chursy' ), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], ] ); $this->add_control( 'name', [ 'label' => esc_html__( 'Name', 'chursy' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( 'Eleanor Pena', 'chursy' ), ] ); $this->add_control( 'job', [ 'label' => esc_html__( 'Job', 'chursy' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( 'Sir Brandman', 'chursy' ), ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'list_icon', [ 'label' => esc_html__( 'Icon', 'chursy' ), 'type' => \Elementor\Controls_Manager::ICONS, 'label_block' => true, 'default' => [ 'value' => 'fab fa-google', 'library' => 'all', ], ] ); $repeater->add_control( 'list_link', [ 'label' => esc_html__( 'Link', 'chursy' ), 'type' => \Elementor\Controls_Manager::URL, 'placeholder' => esc_html__( 'https://your-link.com', 'chursy' ), 'options' => [ 'url', 'is_external', 'nofollow' ], 'default' => [ 'url' => '#', 'is_external' => true, 'nofollow' => true, 'custom_attributes' => '', ], 'label_block' => true, ] ); $this->add_control( 'socials', [ 'label' => esc_html__( 'Item Socials', 'chursy' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'list_icon' => [ 'value' => 'fab fa-google', 'library' => 'all', ], ], [ 'list_icon' => [ 'value' => 'fab fa-linkedin', 'library' => 'all', ], ], [ 'list_icon' => [ 'value' => 'fab fa-youtube', 'library' => 'all', ], ], ], ] ); $this->add_responsive_control( 'alignment', [ 'label' => esc_html__( 'Alignment', 'chursy' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'flex-start' => [ 'title' => esc_html__( 'Left', 'chursy' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'chursy' ), 'icon' => 'eicon-text-align-center', ], 'flex-end' => [ 'title' => esc_html__( 'Right', 'chursy' ), 'icon' => 'eicon-text-align-right', ], ], 'toggle' => true, 'selectors' => [ '{{WRAPPER}} .ova-our-team .image' => 'justify-content: {{VALUE}}', '{{WRAPPER}} .ova-our-team .info' => 'justify-content: {{VALUE}}', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'settings_section', [ 'label' => esc_html__( 'Settings', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'background_color', [ 'label' => esc_html__( 'Background Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .info' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'divider_color', [ 'label' => esc_html__( 'Separator Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .info .divider' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'item_margin', [ 'label' => esc_html__( 'Margin', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .info' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'item_padding', [ 'label' => esc_html__( 'Padding', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .info' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); /* Image */ $this->start_controls_section( 'items_style_section', [ 'label' => esc_html__( 'Image', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'image_width', [ 'label' => esc_html__( 'Width', 'chursy' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 180, 'max' => 1290, 'step' => 1, ], '%' => [ 'min' => 20, 'max' => 100, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .image img' => 'max-width: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'image_height', [ 'label' => esc_html__( 'Height', 'chursy' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 180, 'max' => 690, 'step' => 1, ], '%' => [ 'min' => 20, 'max' => 100, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .image img' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'image_border_radius', [ 'label' => esc_html__( 'Border Radius', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'name_section', [ 'label' => esc_html__( 'Name', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'name_margin', [ 'label' => esc_html__( 'Margin', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .info .name' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'name_padding', [ 'label' => esc_html__( 'Padding', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .info .name' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'name_typography', 'selector' => '{{WRAPPER}} .ova-our-team .info .name', ] ); $this->add_control( 'name_color', [ 'label' => esc_html__( 'Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .info .name' => 'color: {{VALUE}}', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'job_section', [ 'label' => esc_html__( 'Job', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'job_margin', [ 'label' => esc_html__( 'Margin', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .info .job' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'job_padding', [ 'label' => esc_html__( 'Padding', 'chursy' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .info .job' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'job_typography', 'selector' => '{{WRAPPER}} .ova-our-team .info .job', ] ); $this->add_control( 'job_color', [ 'label' => esc_html__( 'Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .info .job' => 'color: {{VALUE}}', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'share_icon_section', [ 'label' => esc_html__( 'Share Icon', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'share_icon_size', [ 'label' => esc_html__( 'Size', 'chursy' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button .share-icon i' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'share_icon_color', [ 'label' => esc_html__( 'Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button .share-icon i' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'share_icon_color_hover', [ 'label' => esc_html__( 'Color Hover', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team:hover .share-button .share-icon i' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'share_icon_background_color', [ 'label' => esc_html__( 'Background Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'share_icon_background_color_hover', [ 'label' => esc_html__( 'Background Color Hover', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team:hover .share-button' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'share_icon_border_color', [ 'label' => esc_html__( 'Border Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button' => 'border-color: {{VALUE}}', ], ] ); $this->add_control( 'share_icon_border_color_hover', [ 'label' => esc_html__( 'Border Color Hover', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team:hover .share-button' => 'border-color: {{VALUE}}', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'socials_section', [ 'label' => esc_html__( 'Socials', 'chursy' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'socials_hover_direction', [ 'label' => esc_html__('Hover Direction', 'chursy'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'bottom', 'options' => [ 'bottom' => esc_html__('Bottom', 'chursy'), 'top' => esc_html__('Top', 'chursy'), ] ] ); $this->add_control( 'icon_size', [ 'label' => esc_html__( 'Icon Size', 'chursy' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button .socials li a i' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__( 'Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button .socials li a i' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'icon_color_hover', [ 'label' => esc_html__( 'Color Hover', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button .socials li a:hover i' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'icon_background_color', [ 'label' => esc_html__( 'Background Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button .socials li a' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'icon_background_color_hover', [ 'label' => esc_html__( 'Background Color Hover', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button .socials li a:hover' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'icon_border_color', [ 'label' => esc_html__( 'Border Color', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button .socials li a' => 'border-color: {{VALUE}}', ], ] ); $this->add_control( 'icon_border_color_hover', [ 'label' => esc_html__( 'Border Color Hover', 'chursy' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-our-team .share-button .socials li a:hover' => 'border-color: {{VALUE}}', ], ] ); $this->end_controls_section(); } // Render Template Here protected function render() { $settings = $this->get_settings(); $name = $settings['name']; $job = $settings['job']; $socials = $settings['socials']; $img_url = $settings['image']['url']; $img_alt = ( isset( $settings['image']['alt']) && $settings['image']['alt'] != '' ) ? $settings['image']['alt'] : $name; $socials_hover_direction = $settings['socials_hover_direction']; ?> <div class="ova-our-team"> <?php if ( $img_url ): ?> <div class="image"> <img src="<?php echo esc_url( $img_url ); ?>" alt="<?php echo esc_attr( $img_alt ); ?>"> </div> <?php endif; ?> <div class="info"> <div class="share-button"> <div class="share-icon"> <i class="fas fa-share-alt"></i> </div> <?php if ( $socials ): ?> <ul class="socials <?php echo esc_attr($socials_hover_direction);?>"> <?php foreach ($socials as $item): $social_url = $item['list_link']['url']; $social_target = ( isset( $item['list_link']['is_external'] ) && $item['list_link']['is_external'] == 'on' ) ? '_blank' : '_self'; $social_nofollow = ( isset( $item['nofollow'] ) && $item['nofollow'] ) ? ' rel="nofollow"' : ''; $icon = $item['list_icon']; ?> <li> <a href="<?php echo esc_url( $social_url ); ?>" target="<?php echo esc_attr( $social_target ); ?>" <?php printf( $social_nofollow ); ?>> <?php if ( $icon ) { \Elementor\Icons_Manager::render_icon( $icon, [ 'aria-hidden' => 'true' ] ); } ?> </a> </li> <?php endforeach; ?> </ul> <?php endif; ?> </div> <div class="divider"></div> <div class="right"> <?php if ( $name ): ?> <h3 class="name"> <?php echo esc_html( $name ); ?> </h3> <?php endif; ?> <?php if ($job): ?> <p class="job"> <?php echo esc_html( $job ); ?> </p> <?php endif; ?> </div> </div> </div> <?php } } $widgets_manager->register( new Chursy_Elementor_Our_Team() );