🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-06-14 13:42:31 | PHP 8.1.34
📂
/ (Root)
/
home
/
therahul
/
ramailobhela.com
/
wp-content
/
themes
/
nighty
/
elementor
/
widgets
📍 /home/therahul/ramailobhela.com/wp-content/themes/nighty/elementor/widgets
🔄 Refresh
✏️
Editing: icon-box.php
Writable
<?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 Nighty_Elementor_Icon_Box extends Widget_Base { public function get_name() { return 'nighty_elementor_icon_box'; } public function get_title() { return esc_html__( 'Ova Icon Box', 'nighty' ); } public function get_icon() { return ' eicon-icon-box'; } public function get_categories() { return [ 'nighty' ]; } 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', 'nighty' ), ] ); $this->add_control( 'prefix', [ 'label' => esc_html__( 'Prefix', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( ':', 'nighty' ), 'placeholder' => esc_html__( 'Type your prefix here', 'nighty' ), ] ); $this->add_control( 'icon', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'flaticon flaticon-calendar', 'library' => 'flaticon', ], ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Title', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'default' => esc_html__( 'Corporate Events', 'nighty' ), 'placeholder' => esc_html__( 'Type your title here', 'nighty' ), ] ); $this->add_control( 'link', [ 'label' => esc_html__( 'Link', 'nighty' ), 'type' => \Elementor\Controls_Manager::URL, 'placeholder' => esc_html__( 'https://your-link.com', 'nighty' ), 'options' => [ 'url', 'is_external', 'nofollow' ], 'default' => [ 'url' => '#', 'is_external' => false, 'nofollow' => false, ], ] ); $this->add_control( 'description', [ 'label' => esc_html__( 'Feature Title', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'default' => esc_html__( 'arrange some events', 'nighty' ), 'placeholder' => esc_html__( 'Type your title here', 'nighty' ), ] ); $this->add_control( 'show_special_word', [ 'label' => esc_html__( 'Show Special Text', 'nighty' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'nighty' ), 'label_off' => esc_html__( 'Hide', 'nighty' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'special_word_position', [ 'label' => esc_html__( 'Special Text Position', 'nighty' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'min' => 0, 'max' => 20, 'step' => 1, 'default' => 1, 'description' => esc_html__( '( 0 is first word )', 'nighty' ), 'condition' => [ 'show_special_word' => 'yes', ], ] ); $this->add_control( 'show_icon_read_more', [ 'label' => esc_html__( 'Show Icon Read More', 'nighty' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'nighty' ), 'label_off' => esc_html__( 'Hide', 'nighty' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'icon_read_more', [ 'label' => esc_html__( 'Icon Read More', 'nighty' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'ovaicon ovaicon-up-arrow', 'library' => 'ovaicon', ], 'condition' => [ 'show_icon_read_more' => 'yes', ], ] ); $this->add_responsive_control( 'alignment', [ 'label' => esc_html__( 'Text Align', 'nighty' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'nighty' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'nighty' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'nighty' ), 'icon' => 'eicon-text-align-right', ], ], 'toggle' => true, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content ' => 'text-align: {{VALUE}};', ], ] ); $this->end_controls_section(); //SECTION TAB STYLE PREFIX $this->start_controls_section( 'section_prefix_style', [ 'label' => esc_html__( 'Prefix', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'content_typography_prefix', 'label' => esc_html__( 'Typography', 'nighty' ), 'selector' => '{{WRAPPER}} .ova-icon-box .prefix', ] ); $this->add_control( 'color_prefix', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .prefix' => 'color : {{VALUE}};', ], ] ); $this->add_responsive_control( 'margin_prefix', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .prefix' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); //END SECTION TAB STYLE PREFIX $this->start_controls_section( 'section_content_style', [ 'label' => esc_html__( 'Content', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'content_background_color', [ 'label' => esc_html__( 'Background Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content' => 'background-color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'content_padding', [ 'label' => esc_html__( 'Padding', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'content_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_icon_style', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'icon_size', [ 'label' => esc_html__( 'Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 300, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .ova-icon-box .content .icon svg' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon' => 'color : {{VALUE}};', '{{WRAPPER}} .ova-icon-box .content .icon svg, {{WRAPPER}} .ova-icon-box .content .icon svg path' => 'fill : {{VALUE}};' ], ] ); $this->add_responsive_control( 'icon_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // End Icon Style Tab //SECTION TAB STYLE TITLE $this->start_controls_section( 'section_title_style', [ 'label' => esc_html__( 'Title', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'content_typography_title', 'label' => esc_html__( 'Typography', 'nighty' ), 'selector' => '{{WRAPPER}} .ova-icon-box .content .title', ] ); $this->add_control( 'color_title', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .title' => 'color : {{VALUE}};', ], ] ); $this->add_responsive_control( 'margin_title', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); //END SECTION TAB STYLE TITLE //SECTION TAB STYLE DESCRIPTION $this->start_controls_section( 'section_description_style', [ 'label' => esc_html__( 'Description', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'content_typography_description', 'label' => esc_html__( 'Typography', 'nighty' ), 'selector' => '{{WRAPPER}} .ova-icon-box .content .description', ] ); $this->add_control( 'color_description', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .description' => 'color : {{VALUE}};', ], ] ); $this->add_control( 'special_color_description', [ 'label' => esc_html__( 'Special Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .description .special-word' => 'color : {{VALUE}};', ], ] ); $this->add_responsive_control( 'margin_description', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); //END SECTION TAB STYLE DESCRIPTION $this->start_controls_section( 'section_icon_read_more_style', [ 'label' => esc_html__( 'Icon Read More', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'icon_read_more_background_size', [ 'label' => esc_html__( 'Background Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 100, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon-read-more ' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_read_more_background_color', [ 'label' => esc_html__( 'Background Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon-read-more ' => 'background-color : {{VALUE}};', ], ] ); $this->add_control( 'icon_read_more_background_color_hover', [ 'label' => esc_html__( 'Background Color Hover', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon-read-more:hover ' => 'background-color : {{VALUE}};', ], ] ); $this->add_responsive_control( 'icon_read_more_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon-read-more' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_read_more_border_radius', [ 'label' => esc_html__( 'Border Radius', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon-read-more' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'icon_read_more_heading', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_responsive_control( 'icon_read_more_size', [ 'label' => esc_html__( 'Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 100, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon-read-more i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .ova-icon-box .content .icon-read-more svg' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_read_more_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon-read-more i' => 'color : {{VALUE}};', '{{WRAPPER}} .ova-icon-box .content .icon-read-more svg, {{WRAPPER}} .ova-icon-box .content .icon-read-more svg path' => 'fill : {{VALUE}};' ], ] ); $this->add_control( 'icon_read_more_color_hover', [ 'label' => esc_html__( 'Color Hover', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon-read-more:hover i' => 'color : {{VALUE}};', ' {{WRAPPER}} .ova-icon-box .content .icon-read-more:hover svg path' => 'fill : {{VALUE}};' ], ] ); $this->add_responsive_control( 'icon_read_more_rotate', [ 'label' => esc_html__( 'Rotate', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'deg' , 'px' ], 'range' => [ 'deg' => [ 'min' => 0, 'max' => 360, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-icon-box .content .icon-read-more i' => 'transform: rotate({{SIZE}}{{UNIT}}) ;', ], ] ); $this->end_controls_section(); // End Icon Style Tab } // Render Template Here protected function render() { $settings = $this->get_settings(); $prefix = $settings['prefix']; $title = $settings['title']; $description = $settings['description']; $special_word_position = $settings['special_word_position'] ? $settings['special_word_position'] : 0 ; $link = $settings['link']['url']; $target = $settings['link']['is_external'] ? '_blank' : '_self'; $nofollow = ( isset( $settings['link']['nofollow'] ) && $settings['link']['nofollow'] ) ? 'rel=nofollow' : ''; $show_special_word = $settings['show_special_word']; $show_icon_read_more = $settings['show_icon_read_more']; if( $show_special_word == 'yes' ) { // replace % to %% avoid printf error if(strpos($description, '%') !== false){ $description = str_replace('%', '%%', $description); } $explode_description = explode(' ', $description); $replace = '<span class="special-word">' . $explode_description[$special_word_position] . '</span>'; $description = str_replace( $explode_description[$special_word_position], $replace, $description ); } ?> <div class="ova-icon-box"> <?php if($prefix) { ?> <span class="prefix"><?php echo esc_html($prefix); ?></span> <?php } ?> <?php if($link) { ?> <a href="<?php echo esc_attr($link); ?>" class="content" target='<?php echo esc_attr($target); ?>' <?php echo esc_attr($nofollow); ?> > <?php }else{ ?> <div class="content"> <?php } ?> <span class="icon"><?php \Elementor\Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] ); ?></span> <h3 class="title"><?php printf($title); ?></h3> <p class="description"><?php printf($description); ?></p> <?php if( $show_icon_read_more == 'yes' ) { ?> <span class="icon-read-more"> <?php \Elementor\Icons_Manager::render_icon( $settings['icon_read_more'], [ 'aria-hidden' => 'true' ] ); ?> </span> <?php } ?> <?php if($link) { ?> </a> <?php }else{ ?> </div> <?php } ?> <?php ?> </div> <?php } } $widgets_manager->register( new Nighty_Elementor_Icon_Box() );
💾 Save Changes
❌ Cancel