Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
forbidals
/
wp-content
/
plugins
/
credio-addons
/
widgets
/
divider
:
divider.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php /** * Elementor rsgallery Widget. * * Elementor widget that inserts an embbedable content into the page, from any given URL. * * @since 1.0.0 */ use Elementor\Group_Control_Css_Filter; use Elementor\Repeater; use Elementor\Controls_Manager; use Elementor\Group_Control_Box_Shadow; use Elementor\Group_Control_Image_Size; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Border; use Elementor\Group_Control_Background; use Elementor\Utils; defined('ABSPATH') || die(); class Rsaddon_Divider_Pro_Widget extends \Elementor\Widget_Base { /** * Get widget name. * * Retrieve rsgallery widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'rs-divider'; } /** * Get widget title. * * Retrieve rsgallery widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return __('RS Divider', 'rsaddon'); } /** * Get widget icon. * * Retrieve rsgallery widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'rs-badge'; } /** * Get widget categories. * * Retrieve the list of categories the rsgallery widget belongs to. * * @since 1.0.0 * @access public * * @return array Widget categories. */ public function get_categories() { return ['rsaddon_category']; } /** * Register rsgallery widget controls. * * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 * @access protected */ protected function register_controls() { // Global Control Start $this->start_controls_section( 'g_setting_section', [ 'label' => esc_html__('Setting', 'rsaddon'), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_control( 'divider_text', [ 'label' => esc_html__( 'Divider Text', 'rsaddon' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Type your text here', 'rsaddon' ), ] ); $this->add_responsive_control( 'g_width', [ 'label' => esc_html__( 'Width', 'rsaddon' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .rs-divider' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'g_height', [ 'label' => esc_html__( 'Height', 'rsaddon' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 50, ], 'selectors' => [ '{{WRAPPER}} .rs-divider' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'g_padding', [ 'label' => esc_html__( 'Padding', 'rsaddon' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'custom' ], 'selectors' => [ '{{WRAPPER}} .rs-divider' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ] ] ); $this->add_responsive_control( 'g_margin', [ 'label' => esc_html__( 'Margin', 'rsaddon' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'custom' ], 'selectors' => [ '{{WRAPPER}} .rs-divider' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ] ] ); $this->add_responsive_control( 'g_radius', [ 'label' => esc_html__( 'Border Radius', 'rsaddon' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'custom' ], 'selectors' => [ '{{WRAPPER}} .rs-divider' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ] ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'g_background', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .rs-divider', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'g_border', 'selector' => '{{WRAPPER}} .rs-divider', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'g_box_shadow', 'selector' => '{{WRAPPER}} .rs-divider', ] ); $this->end_controls_section(); // Global Control End } /** * Render rsgallery widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $txt = $settings['divider_text']; if (empty($txt)) { $txt = ' '; } ?> <div class="rs-divider"><?php echo esc_html($txt); ?></div> <?php } }