File manager - Edit - /home/premiey/www/wp-includes/images/media/groups.tar
Back
background.php 0000666 00000055100 15165620442 0007406 0 ustar 00 <?php namespace Elementor; use Elementor\Core\Breakpoints\Manager as Breakpoints_Manager; use Elementor\Modules\DynamicTags\Module as TagsModule; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor background control. * * A base control for creating background control. Displays input fields to define * the background color, background image, background gradient or background video. * * @since 1.2.2 */ class Group_Control_Background extends Group_Control_Base { /** * Fields. * * Holds all the background control fields. * * @since 1.2.2 * @access protected * @static * * @var array Background control fields. */ protected static $fields; /** * Background Types. * * Holds all the available background types. * * @since 1.2.2 * @access private * @static * * @var array */ private static $background_types; /** * Get background control type. * * Retrieve the control type, in this case `background`. * * @since 1.0.0 * @access public * @static * * @return string Control type. */ public static function get_type() { return 'background'; } /** * Get background control types. * * Retrieve available background types. * * @since 1.2.2 * @access public * @static * * @return array Available background types. */ public static function get_background_types() { if ( null === self::$background_types ) { self::$background_types = self::get_default_background_types(); } return self::$background_types; } /** * Get Default background types. * * Retrieve background control initial types. * * @since 2.0.0 * @access private * @static * * @return array Default background types. */ private static function get_default_background_types() { return [ 'classic' => [ 'title' => esc_html_x( 'Classic', 'Background Control', 'elementor' ), 'icon' => 'eicon-paint-brush', ], 'gradient' => [ 'title' => esc_html_x( 'Gradient', 'Background Control', 'elementor' ), 'icon' => 'eicon-barcode', ], 'video' => [ 'title' => esc_html_x( 'Video', 'Background Control', 'elementor' ), 'icon' => 'eicon-video-camera', ], 'slideshow' => [ 'title' => esc_html_x( 'Slideshow', 'Background Control', 'elementor' ), 'icon' => 'eicon-slideshow', ], ]; } /** * Init fields. * * Initialize background control fields. * * @since 1.2.2 * @access public * * @return array Control fields. */ public function init_fields() { $fields = []; $fields['background'] = [ 'label' => esc_html_x( 'Background Type', 'Background Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'render_type' => 'ui', ]; $fields['color'] = [ 'label' => esc_html_x( 'Color', 'Background Control', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'title' => esc_html_x( 'Background Color', 'Background Control', 'elementor' ), 'selectors' => [ '{{SELECTOR}}' => 'background-color: {{VALUE}};', ], 'condition' => [ 'background' => [ 'classic', 'gradient', 'video' ], ], ]; $fields['color_stop'] = [ 'label' => esc_html_x( 'Location', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ '%', 'custom' ], 'default' => [ 'unit' => '%', 'size' => 0, ], 'render_type' => 'ui', 'condition' => [ 'background' => [ 'gradient' ], ], 'of_type' => 'gradient', ]; $fields['color_b'] = [ 'label' => esc_html_x( 'Second Color', 'Background Control', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#f2295b', 'render_type' => 'ui', 'condition' => [ 'background' => [ 'gradient' ], ], 'of_type' => 'gradient', ]; $fields['color_b_stop'] = [ 'label' => esc_html_x( 'Location', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ '%', 'custom' ], 'default' => [ 'unit' => '%', 'size' => 100, ], 'render_type' => 'ui', 'condition' => [ 'background' => [ 'gradient' ], ], 'of_type' => 'gradient', ]; $fields['gradient_type'] = [ 'label' => esc_html_x( 'Type', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'linear' => esc_html_x( 'Linear', 'Background Control', 'elementor' ), 'radial' => esc_html_x( 'Radial', 'Background Control', 'elementor' ), ], 'default' => 'linear', 'render_type' => 'ui', 'condition' => [ 'background' => [ 'gradient' ], ], 'of_type' => 'gradient', ]; $fields['gradient_angle'] = [ 'label' => esc_html_x( 'Angle', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'deg', 'grad', 'rad', 'turn', 'custom' ], 'default' => [ 'unit' => 'deg', 'size' => 180, ], 'selectors' => [ '{{SELECTOR}}' => 'background-color: transparent; background-image: linear-gradient({{SIZE}}{{UNIT}}, {{color.VALUE}} {{color_stop.SIZE}}{{color_stop.UNIT}}, {{color_b.VALUE}} {{color_b_stop.SIZE}}{{color_b_stop.UNIT}})', ], 'condition' => [ 'background' => [ 'gradient' ], 'gradient_type' => 'linear', ], 'of_type' => 'gradient', ]; $fields['gradient_position'] = [ 'label' => esc_html_x( 'Position', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'center center' => esc_html_x( 'Center Center', 'Background Control', 'elementor' ), 'center left' => esc_html_x( 'Center Left', 'Background Control', 'elementor' ), 'center right' => esc_html_x( 'Center Right', 'Background Control', 'elementor' ), 'top center' => esc_html_x( 'Top Center', 'Background Control', 'elementor' ), 'top left' => esc_html_x( 'Top Left', 'Background Control', 'elementor' ), 'top right' => esc_html_x( 'Top Right', 'Background Control', 'elementor' ), 'bottom center' => esc_html_x( 'Bottom Center', 'Background Control', 'elementor' ), 'bottom left' => esc_html_x( 'Bottom Left', 'Background Control', 'elementor' ), 'bottom right' => esc_html_x( 'Bottom Right', 'Background Control', 'elementor' ), ], 'default' => 'center center', 'selectors' => [ '{{SELECTOR}}' => 'background-color: transparent; background-image: radial-gradient(at {{VALUE}}, {{color.VALUE}} {{color_stop.SIZE}}{{color_stop.UNIT}}, {{color_b.VALUE}} {{color_b_stop.SIZE}}{{color_b_stop.UNIT}})', ], 'condition' => [ 'background' => [ 'gradient' ], 'gradient_type' => 'radial', ], 'of_type' => 'gradient', ]; $fields['image'] = [ 'label' => esc_html_x( 'Image', 'Background Control', 'elementor' ), 'type' => Controls_Manager::MEDIA, 'ai' => [ 'category' => 'background', ], 'dynamic' => [ 'active' => true, ], 'responsive' => true, 'title' => esc_html_x( 'Background Image', 'Background Control', 'elementor' ), 'selectors' => [ '{{SELECTOR}}' => 'background-image: url("{{URL}}");', ], 'has_sizes' => true, 'render_type' => 'template', 'condition' => [ 'background' => [ 'classic' ], ], ]; $fields['position'] = [ 'label' => esc_html_x( 'Position', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'separator' => 'before', 'responsive' => true, 'options' => [ '' => esc_html_x( 'Default', 'Background Control', 'elementor' ), 'center center' => esc_html_x( 'Center Center', 'Background Control', 'elementor' ), 'center left' => esc_html_x( 'Center Left', 'Background Control', 'elementor' ), 'center right' => esc_html_x( 'Center Right', 'Background Control', 'elementor' ), 'top center' => esc_html_x( 'Top Center', 'Background Control', 'elementor' ), 'top left' => esc_html_x( 'Top Left', 'Background Control', 'elementor' ), 'top right' => esc_html_x( 'Top Right', 'Background Control', 'elementor' ), 'bottom center' => esc_html_x( 'Bottom Center', 'Background Control', 'elementor' ), 'bottom left' => esc_html_x( 'Bottom Left', 'Background Control', 'elementor' ), 'bottom right' => esc_html_x( 'Bottom Right', 'Background Control', 'elementor' ), 'initial' => esc_html_x( 'Custom', 'Background Control', 'elementor' ), ], 'selectors' => [ '{{SELECTOR}}' => 'background-position: {{VALUE}};', ], 'condition' => [ 'background' => [ 'classic' ], 'image[url]!' => '', ], ]; $fields['xpos'] = [ 'label' => esc_html_x( 'X Position', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'responsive' => true, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'default' => [ 'size' => 0, ], 'tablet_default' => [ 'size' => 0, ], 'mobile_default' => [ 'size' => 0, ], 'range' => [ 'px' => [ 'min' => -800, 'max' => 800, ], 'em' => [ 'min' => -100, 'max' => 100, ], '%' => [ 'min' => -100, 'max' => 100, ], 'vw' => [ 'min' => -100, 'max' => 100, ], ], 'selectors' => [ '{{SELECTOR}}' => 'background-position: {{SIZE}}{{UNIT}} {{ypos.SIZE}}{{ypos.UNIT}}', ], 'condition' => [ 'background' => [ 'classic' ], 'position' => [ 'initial' ], 'image[url]!' => '', ], 'required' => true, ]; $fields['ypos'] = [ 'label' => esc_html_x( 'Y Position', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'responsive' => true, 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'custom' ], 'default' => [ 'size' => 0, ], 'tablet_default' => [ 'size' => 0, ], 'mobile_default' => [ 'size' => 0, ], 'range' => [ 'px' => [ 'min' => -800, 'max' => 800, ], 'em' => [ 'min' => -100, 'max' => 100, ], '%' => [ 'min' => -100, 'max' => 100, ], 'vh' => [ 'min' => -100, 'max' => 100, ], ], 'selectors' => [ '{{SELECTOR}}' => 'background-position: {{xpos.SIZE}}{{xpos.UNIT}} {{SIZE}}{{UNIT}}', ], 'condition' => [ 'background' => [ 'classic' ], 'position' => [ 'initial' ], 'image[url]!' => '', ], 'required' => true, ]; $fields['attachment'] = [ 'label' => esc_html_x( 'Attachment', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => esc_html_x( 'Default', 'Background Control', 'elementor' ), 'scroll' => esc_html_x( 'Scroll', 'Background Control', 'elementor' ), 'fixed' => esc_html_x( 'Fixed', 'Background Control', 'elementor' ), ], 'selectors' => [ '(desktop+){{SELECTOR}}' => 'background-attachment: {{VALUE}};', ], 'condition' => [ 'background' => [ 'classic' ], 'image[url]!' => '', ], ]; $fields['attachment_alert'] = [ 'type' => Controls_Manager::RAW_HTML, 'content_classes' => 'elementor-control-field-description', 'raw' => esc_html__( 'Note: Attachment Fixed works only on desktop.', 'elementor' ), 'separator' => 'none', 'condition' => [ 'background' => [ 'classic' ], 'image[url]!' => '', 'attachment' => 'fixed', ], ]; $fields['repeat'] = [ 'label' => esc_html_x( 'Repeat', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'responsive' => true, 'options' => [ '' => esc_html_x( 'Default', 'Background Control', 'elementor' ), 'no-repeat' => esc_html_x( 'No-repeat', 'Background Control', 'elementor' ), 'repeat' => esc_html_x( 'Repeat', 'Background Control', 'elementor' ), 'repeat-x' => esc_html_x( 'Repeat-x', 'Background Control', 'elementor' ), 'repeat-y' => esc_html_x( 'Repeat-y', 'Background Control', 'elementor' ), ], 'selectors' => [ '{{SELECTOR}}' => 'background-repeat: {{VALUE}};', ], 'condition' => [ 'background' => [ 'classic' ], 'image[url]!' => '', ], ]; $fields['size'] = [ 'label' => esc_html_x( 'Display Size', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'responsive' => true, 'default' => '', 'options' => [ '' => esc_html_x( 'Default', 'Background Control', 'elementor' ), 'auto' => esc_html_x( 'Auto', 'Background Control', 'elementor' ), 'cover' => esc_html_x( 'Cover', 'Background Control', 'elementor' ), 'contain' => esc_html_x( 'Contain', 'Background Control', 'elementor' ), 'initial' => esc_html_x( 'Custom', 'Background Control', 'elementor' ), ], 'selectors' => [ '{{SELECTOR}}' => 'background-size: {{VALUE}};', ], 'condition' => [ 'background' => [ 'classic' ], 'image[url]!' => '', ], ]; $fields['bg_width'] = [ 'label' => esc_html_x( 'Width', 'Background Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'responsive' => true, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, ], '%' => [ 'min' => 0, 'max' => 100, ], 'vw' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'size' => 100, 'unit' => '%', ], 'required' => true, 'selectors' => [ '{{SELECTOR}}' => 'background-size: {{SIZE}}{{UNIT}} auto', ], 'condition' => [ 'background' => [ 'classic' ], 'size' => [ 'initial' ], 'image[url]!' => '', ], ]; $fields['video_link'] = [ 'label' => esc_html_x( 'Video Link', 'Background Control', 'elementor' ), 'type' => Controls_Manager::TEXT, 'placeholder' => 'https://www.youtube.com/watch?v=XHOmBV4js_E', 'description' => esc_html__( 'YouTube/Vimeo link, or link to video file (mp4 is recommended).', 'elementor' ), 'label_block' => true, 'default' => '', 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, TagsModule::URL_CATEGORY, ], ], 'condition' => [ 'background' => [ 'video' ], ], 'of_type' => 'video', 'frontend_available' => true, ]; $fields['video_start'] = [ 'label' => esc_html__( 'Start Time', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'description' => esc_html__( 'Specify a start time (in seconds)', 'elementor' ), 'placeholder' => 10, 'condition' => [ 'background' => [ 'video' ], ], 'of_type' => 'video', 'frontend_available' => true, ]; $fields['video_end'] = [ 'label' => esc_html__( 'End Time', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'description' => esc_html__( 'Specify an end time (in seconds)', 'elementor' ), 'placeholder' => 70, 'condition' => [ 'background' => [ 'video' ], ], 'of_type' => 'video', 'frontend_available' => true, ]; $fields['play_once'] = [ 'label' => esc_html__( 'Play Once', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'background' => [ 'video' ], ], 'of_type' => 'video', 'frontend_available' => true, ]; $fields['play_on_mobile'] = [ 'label' => esc_html__( 'Play On Mobile', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'background' => [ 'video' ], ], 'of_type' => 'video', 'frontend_available' => true, ]; // This control was added to handle a bug with the Youtube Embed API. The bug: If there is a video with Privacy // Mode on, and at the same time the page contains another video WITHOUT privacy mode on, one of the videos // will not run properly. This added control allows users to align all their videos to one host (either // youtube.com or youtube-nocookie.com, depending on whether the user wants privacy mode on or not). $fields['privacy_mode'] = [ 'label' => esc_html__( 'Privacy Mode', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'background' => [ 'video' ], ], 'of_type' => 'video', 'frontend_available' => true, ]; $fields['video_fallback'] = [ 'label' => esc_html_x( 'Background Fallback', 'Background Control', 'elementor' ), 'description' => esc_html__( 'This cover image will replace the background video in case that the video could not be loaded.', 'elementor' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, ], 'condition' => [ 'background' => [ 'video' ], ], 'selectors' => [ '{{SELECTOR}}' => 'background: url("{{URL}}") 50% 50%; background-size: cover;', ], 'of_type' => 'video', ]; $fields['slideshow_gallery'] = [ 'label' => esc_html_x( 'Images', 'Background Control', 'elementor' ), 'type' => Controls_Manager::GALLERY, 'condition' => [ 'background' => [ 'slideshow' ], ], 'show_label' => false, 'of_type' => 'slideshow', 'frontend_available' => true, ]; $fields['slideshow_loop'] = [ 'label' => esc_html__( 'Infinite Loop', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'condition' => [ 'background' => [ 'slideshow' ], ], 'of_type' => 'slideshow', 'frontend_available' => true, ]; $fields['slideshow_slide_duration'] = [ 'label' => esc_html__( 'Duration', 'elementor' ) . ' (ms)', 'type' => Controls_Manager::NUMBER, 'default' => 5000, 'condition' => [ 'background' => [ 'slideshow' ], ], 'frontend_available' => true, ]; $fields['slideshow_slide_transition'] = [ 'label' => esc_html__( 'Transition', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'fade', 'options' => [ 'fade' => 'Fade', 'slide_right' => 'Slide Right', 'slide_left' => 'Slide Left', 'slide_up' => 'Slide Up', 'slide_down' => 'Slide Down', ], 'condition' => [ 'background' => [ 'slideshow' ], ], 'of_type' => 'slideshow', 'frontend_available' => true, ]; $fields['slideshow_transition_duration'] = [ 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (ms)', 'type' => Controls_Manager::NUMBER, 'default' => 500, 'condition' => [ 'background' => [ 'slideshow' ], ], 'frontend_available' => true, ]; $fields['slideshow_background_size'] = [ 'label' => esc_html__( 'Background Size', 'elementor' ), 'type' => Controls_Manager::SELECT, 'responsive' => true, 'default' => '', 'options' => [ '' => esc_html__( 'Default', 'elementor' ), 'auto' => esc_html__( 'Auto', 'elementor' ), 'cover' => esc_html__( 'Cover', 'elementor' ), 'contain' => esc_html__( 'Contain', 'elementor' ), ], 'selectors' => [ '{{WRAPPER}} .elementor-background-slideshow__slide__image' => 'background-size: {{VALUE}};', ], 'condition' => [ 'background' => [ 'slideshow' ], ], ]; $fields['slideshow_background_position'] = [ 'label' => esc_html__( 'Background Position', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'responsive' => true, 'options' => [ '' => esc_html__( 'Default', 'elementor' ), 'center center' => esc_html_x( 'Center Center', 'Background Control', 'elementor' ), 'center left' => esc_html_x( 'Center Left', 'Background Control', 'elementor' ), 'center right' => esc_html_x( 'Center Right', 'Background Control', 'elementor' ), 'top center' => esc_html_x( 'Top Center', 'Background Control', 'elementor' ), 'top left' => esc_html_x( 'Top Left', 'Background Control', 'elementor' ), 'top right' => esc_html_x( 'Top Right', 'Background Control', 'elementor' ), 'bottom center' => esc_html_x( 'Bottom Center', 'Background Control', 'elementor' ), 'bottom left' => esc_html_x( 'Bottom Left', 'Background Control', 'elementor' ), 'bottom right' => esc_html_x( 'Bottom Right', 'Background Control', 'elementor' ), ], 'selectors' => [ '{{WRAPPER}} .elementor-background-slideshow__slide__image' => 'background-position: {{VALUE}};', ], 'condition' => [ 'background' => [ 'slideshow' ], ], ]; $fields['slideshow_lazyload'] = [ 'label' => esc_html__( 'Lazyload', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'separator' => 'before', 'condition' => [ 'background' => [ 'slideshow' ], ], 'of_type' => 'slideshow', 'frontend_available' => true, ]; $fields['slideshow_ken_burns'] = [ 'label' => esc_html__( 'Ken Burns Effect', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'separator' => 'before', 'condition' => [ 'background' => [ 'slideshow' ], ], 'of_type' => 'slideshow', 'frontend_available' => true, ]; $fields['slideshow_ken_burns_zoom_direction'] = [ 'label' => esc_html__( 'Direction', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'in', 'options' => [ 'in' => esc_html__( 'In', 'elementor' ), 'out' => esc_html__( 'Out', 'elementor' ), ], 'condition' => [ 'background' => [ 'slideshow' ], 'slideshow_ken_burns!' => '', ], 'of_type' => 'slideshow', 'frontend_available' => true, ]; return $fields; } /** * Get child default args. * * Retrieve the default arguments for all the child controls for a specific group * control. * * @since 1.2.2 * @access protected * * @return array Default arguments for all the child controls. */ protected function get_child_default_args() { return [ 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}}:not(.elementor-motion-effects-element-type-background), {{WRAPPER}} > .elementor-motion-effects-container > .elementor-motion-effects-layer', ]; } /** * Filter fields. * * Filter which controls to display, using `include`, `exclude`, `condition` * and `of_type` arguments. * * @since 1.2.2 * @access protected * * @return array Control fields. */ protected function filter_fields() { $fields = parent::filter_fields(); $args = $this->get_args(); foreach ( $fields as &$field ) { if ( isset( $field['of_type'] ) && ! in_array( $field['of_type'], $args['types'] ) ) { unset( $field ); } } return $fields; } /** * Prepare fields. * * Process background control fields before adding them to `add_control()`. * * @since 1.2.2 * @access protected * * @param array $fields Background control fields. * * @return array Processed fields. */ protected function prepare_fields( $fields ) { $args = $this->get_args(); $background_types = self::get_background_types(); $choose_types = []; foreach ( $args['types'] as $type ) { if ( isset( $background_types[ $type ] ) ) { $choose_types[ $type ] = $background_types[ $type ]; } } $fields['background']['options'] = $choose_types; return parent::prepare_fields( $fields ); } /** * Get default options. * * Retrieve the default options of the background control. Used to return the * default options while initializing the background control. * * @since 1.9.0 * @access protected * * @return array Default background control options. */ protected function get_default_options() { return [ 'popover' => false, ]; } } flex-item.php 0000666 00000012640 15165620442 0007163 0 ustar 00 <?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Group_Control_Flex_Item extends Group_Control_Base { protected static $fields; public static function get_type() { return 'flex-item'; } protected function init_fields() { $fields = []; $fields['basis_type'] = [ 'label' => esc_html_x( 'Flex Basis', 'Flex Item Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html_x( 'Default', 'Flex Item Control', 'elementor' ), 'custom' => esc_html_x( 'Custom', 'Flex Item Control', 'elementor' ), ], 'responsive' => true, ]; $fields['basis'] = [ 'label' => esc_html_x( 'Custom Width', 'Flex Item Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, ], '%' => [ 'min' => 0, 'max' => 100, ], 'vw' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => '%', ], 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '{{SELECTOR}}' => '--flex-basis: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'basis_type' => 'custom', ], 'responsive' => true, ]; $fields['align_self'] = [ 'label' => esc_html_x( 'Align Self', 'Flex Item Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'flex-start' => [ 'title' => esc_html_x( 'Start', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-flex eicon-align-start-v', ], 'center' => [ 'title' => esc_html_x( 'Center', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-flex eicon-align-center-v', ], 'flex-end' => [ 'title' => esc_html_x( 'End', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-flex eicon-align-end-v', ], 'stretch' => [ 'title' => esc_html_x( 'Stretch', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-flex eicon-align-stretch-v', ], ], 'default' => '', 'selectors' => [ '{{SELECTOR}}' => '--align-self: {{VALUE}};', ], 'responsive' => true, 'description' => esc_html_x( 'This control will affect contained elements only.', 'Flex Item Control', 'elementor' ), ]; $fields['order'] = [ 'label' => esc_html_x( 'Order', 'Flex Item Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'default' => '', 'options' => [ 'start' => [ 'title' => esc_html_x( 'Start', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-flex eicon-order-start', ], 'end' => [ 'title' => esc_html_x( 'End', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-flex eicon-order-end', ], 'custom' => [ 'title' => esc_html_x( 'Custom', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-ellipsis-v', ], ], 'selectors_dictionary' => [ // Hacks to set the order to start / end. // For example, if the user has 10 widgets, but wants to set the 5th one to be first, // this hack should do the trick while taking in account elements with `order: 0` or less. 'start' => '-99999 /* order start hack */', 'end' => '99999 /* order end hack */', 'custom' => '', ], 'selectors' => [ '{{SELECTOR}}' => '--order: {{VALUE}};', ], 'responsive' => true, 'description' => esc_html_x( 'This control will affect contained elements only.', 'Flex Item Control', 'elementor' ), ]; $fields['order_custom'] = [ 'label' => esc_html_x( 'Custom Order', 'Flex Item Control', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'selectors' => [ '{{SELECTOR}}' => '--order: {{VALUE}};', ], 'responsive' => true, 'condition' => [ 'order' => 'custom', ], ]; $fields['size'] = [ 'label' => esc_html_x( 'Size', 'Flex Item Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'default' => '', 'options' => [ 'none' => [ 'title' => esc_html_x( 'None', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-ban', ], 'grow' => [ 'title' => esc_html_x( 'Grow', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-grow', ], 'shrink' => [ 'title' => esc_html_x( 'Shrink', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-shrink', ], 'custom' => [ 'title' => esc_html_x( 'Custom', 'Flex Item Control', 'elementor' ), 'icon' => 'eicon-ellipsis-v', ], ], 'selectors_dictionary' => [ 'grow' => '--flex-grow: 1; --flex-shrink: 0;', 'shrink' => '--flex-grow: 0; --flex-shrink: 1;', 'custom' => '', 'none' => '--flex-grow: 0; --flex-shrink: 0;', ], 'selectors' => [ '{{SELECTOR}}' => '{{VALUE}};', ], 'responsive' => true, ]; $fields['grow'] = [ 'label' => esc_html_x( 'Flex Grow', 'Flex Item Control', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'selectors' => [ '{{SELECTOR}}' => '--flex-grow: {{VALUE}};', ], 'default' => 1, 'placeholder' => 1, 'responsive' => true, 'condition' => [ 'size' => 'custom', ], ]; $fields['shrink'] = [ 'label' => esc_html_x( 'Flex Shrink', 'Flex Item Control', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'selectors' => [ '{{SELECTOR}}' => '--flex-shrink: {{VALUE}};', ], 'default' => 1, 'placeholder' => 1, 'responsive' => true, 'condition' => [ 'size' => 'custom', ], ]; return $fields; } protected function get_default_options() { return [ 'popover' => false, ]; } } typography.php 0000666 00000022334 15165620442 0007500 0 ustar 00 <?php namespace Elementor; use Elementor\Core\Settings\Page\Manager as PageManager; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor typography control. * * A base control for creating typography control. Displays input fields to define * the content typography including font size, font family, font weight, text * transform, font style, line height and letter spacing. * * @since 1.0.0 */ class Group_Control_Typography extends Group_Control_Base { /** * Fields. * * Holds all the typography control fields. * * @since 1.0.0 * @access protected * @static * * @var array Typography control fields. */ protected static $fields; /** * Scheme fields keys. * * Holds all the typography control scheme fields keys. * Default is an array containing `font_family` and `font_weight`. * * @since 1.0.0 * @access private * @static * * @var array Typography control scheme fields keys. */ private static $_scheme_fields_keys = [ 'font_family', 'font_weight' ]; /** * Get scheme fields keys. * * Retrieve all the available typography control scheme fields keys. * * @since 1.0.0 * @access public * @static * * @return array Scheme fields keys. */ public static function get_scheme_fields_keys() { return self::$_scheme_fields_keys; } /** * Get typography control type. * * Retrieve the control type, in this case `typography`. * * @since 1.0.0 * @access public * @static * * @return string Control type. */ public static function get_type() { return 'typography'; } /** * Init fields. * * Initialize typography control fields. * * @since 1.2.2 * @access protected * * @return array Control fields. */ protected function init_fields() { $fields = []; $kit = Plugin::$instance->kits_manager->get_active_kit_for_frontend(); /** * Retrieve the settings directly from DB, because of an open issue when a controls group is being initialized * from within another group */ $kit_settings = $kit->get_meta( PageManager::META_KEY ); $default_fonts = isset( $kit_settings['default_generic_fonts'] ) ? $kit_settings['default_generic_fonts'] : 'Sans-serif'; if ( $default_fonts ) { $default_fonts = ', ' . $default_fonts; } $fields['font_family'] = [ 'label' => esc_html_x( 'Family', 'Typography Control', 'elementor' ), 'type' => Controls_Manager::FONT, 'default' => '', 'selector_value' => 'font-family: "{{VALUE}}"' . $default_fonts . ';', ]; $fields['font_size'] = [ 'label' => esc_html_x( 'Size', 'Typography Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'vw', 'custom' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 200, ], 'vw' => [ 'min' => 0.1, 'max' => 10, 'step' => 0.1, ], ], 'responsive' => true, 'selector_value' => 'font-size: {{SIZE}}{{UNIT}}', ]; $fields['font_weight'] = [ 'label' => esc_html_x( 'Weight', 'Typography Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '100' => '100 ' . esc_html_x( '(Thin)', 'Typography Control', 'elementor' ), '200' => '200 ' . esc_html_x( '(Extra Light)', 'Typography Control', 'elementor' ), '300' => '300 ' . esc_html_x( '(Light)', 'Typography Control', 'elementor' ), '400' => '400 ' . esc_html_x( '(Normal)', 'Typography Control', 'elementor' ), '500' => '500 ' . esc_html_x( '(Medium)', 'Typography Control', 'elementor' ), '600' => '600 ' . esc_html_x( '(Semi Bold)', 'Typography Control', 'elementor' ), '700' => '700 ' . esc_html_x( '(Bold)', 'Typography Control', 'elementor' ), '800' => '800 ' . esc_html_x( '(Extra Bold)', 'Typography Control', 'elementor' ), '900' => '900 ' . esc_html_x( '(Black)', 'Typography Control', 'elementor' ), '' => esc_html_x( 'Default', 'Typography Control', 'elementor' ), 'normal' => esc_html_x( 'Normal', 'Typography Control', 'elementor' ), 'bold' => esc_html_x( 'Bold', 'Typography Control', 'elementor' ), ], ]; $fields['text_transform'] = [ 'label' => esc_html_x( 'Transform', 'Typography Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => esc_html__( 'Default', 'elementor' ), 'uppercase' => esc_html_x( 'Uppercase', 'Typography Control', 'elementor' ), 'lowercase' => esc_html_x( 'Lowercase', 'Typography Control', 'elementor' ), 'capitalize' => esc_html_x( 'Capitalize', 'Typography Control', 'elementor' ), 'none' => esc_html_x( 'Normal', 'Typography Control', 'elementor' ), ], ]; $fields['font_style'] = [ 'label' => esc_html_x( 'Style', 'Typography Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => esc_html__( 'Default', 'elementor' ), 'normal' => esc_html_x( 'Normal', 'Typography Control', 'elementor' ), 'italic' => esc_html_x( 'Italic', 'Typography Control', 'elementor' ), 'oblique' => esc_html_x( 'Oblique', 'Typography Control', 'elementor' ), ], ]; $fields['text_decoration'] = [ 'label' => esc_html_x( 'Decoration', 'Typography Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => esc_html__( 'Default', 'elementor' ), 'underline' => esc_html_x( 'Underline', 'Typography Control', 'elementor' ), 'overline' => esc_html_x( 'Overline', 'Typography Control', 'elementor' ), 'line-through' => esc_html_x( 'Line Through', 'Typography Control', 'elementor' ), 'none' => esc_html_x( 'None', 'Typography Control', 'elementor' ), ], ]; $fields['line_height'] = [ 'label' => esc_html_x( 'Line-Height', 'Typography Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'desktop_default' => [ 'unit' => 'em', ], 'tablet_default' => [ 'unit' => 'em', ], 'mobile_default' => [ 'unit' => 'em', ], 'range' => [ 'px' => [ 'min' => 1, ], ], 'responsive' => true, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'selector_value' => 'line-height: {{SIZE}}{{UNIT}}', ]; $fields['letter_spacing'] = [ 'label' => esc_html_x( 'Letter Spacing', 'Typography Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => -5, 'max' => 10, 'step' => 0.1, ], 'em' => [ 'step' => 0.1, ], ], 'responsive' => true, 'selector_value' => 'letter-spacing: {{SIZE}}{{UNIT}}', ]; $fields['word_spacing'] = [ 'label' => esc_html_x( 'Word Spacing', 'Typography Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'desktop_default' => [ 'unit' => 'em', ], 'tablet_default' => [ 'unit' => 'em', ], 'mobile_default' => [ 'unit' => 'em', ], 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'step' => 1, ], 'em' => [ 'step' => 0.1, ], ], 'responsive' => true, 'selector_value' => 'word-spacing: {{SIZE}}{{UNIT}}', ]; return $fields; } /** * Prepare fields. * * Process typography control fields before adding them to `add_control()`. * * @since 1.2.3 * @access protected * * @param array $fields Typography control fields. * * @return array Processed fields. */ protected function prepare_fields( $fields ) { array_walk( $fields, function( &$field, $field_name ) { if ( in_array( $field_name, [ 'typography', 'popover_toggle' ] ) ) { return; } $selector_value = ! empty( $field['selector_value'] ) ? $field['selector_value'] : str_replace( '_', '-', $field_name ) . ': {{VALUE}};'; $field['selectors'] = [ '{{SELECTOR}}' => $selector_value, ]; } ); return parent::prepare_fields( $fields ); } /** * Add group arguments to field. * * Register field arguments to typography control. * * @since 1.2.2 * @access protected * * @param string $control_id Typography control id. * @param array $field_args Typography control field arguments. * * @return array Field arguments. */ protected function add_group_args_to_field( $control_id, $field_args ) { $field_args = parent::add_group_args_to_field( $control_id, $field_args ); $field_args['groupPrefix'] = $this->get_controls_prefix(); $field_args['groupType'] = 'typography'; $args = $this->get_args(); if ( in_array( $control_id, self::get_scheme_fields_keys() ) && ! empty( $args['scheme'] ) ) { $field_args['scheme'] = [ 'type' => self::get_type(), 'value' => $args['scheme'], 'key' => $control_id, ]; } return $field_args; } /** * Get default options. * * Retrieve the default options of the typography control. Used to return the * default options while initializing the typography control. * * @since 1.9.0 * @access protected * * @return array Default typography control options. */ protected function get_default_options() { return [ 'popover' => [ 'starter_name' => 'typography', 'starter_title' => esc_html_x( 'Typography', 'Typography Control', 'elementor' ), 'settings' => [ 'render_type' => 'ui', 'groupType' => 'typography', 'global' => [ 'active' => true, ], ], ], ]; } } grid-container.php 0000666 00000020371 15165620442 0010176 0 ustar 00 <?php namespace Elementor; use Elementor\Plugin; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Group_Control_Grid_Container extends Group_Control_Base { protected static $fields; public static function get_type() { return 'grid-container'; } protected function init_fields() { $icon_start = is_rtl() ? 'end' : 'start'; $icon_end = is_rtl() ? 'start' : 'end'; $fields = []; $fields['items_grid'] = [ 'type' => Controls_Manager::HEADING, 'label' => esc_html__( 'Items', 'elementor' ), 'separator' => 'before', ]; $fields['outline'] = [ 'label' => esc_html__( 'Grid Outline', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'elementor' ), 'label_off' => esc_html__( 'Hide', 'elementor' ), 'default' => 'yes', 'frontend_available' => true, ]; $responsive_unit_defaults = $this->get_responsive_unit_defaults(); $fields['columns_grid'] = [ 'label' => esc_html__( 'Columns', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'fr' => [ 'min' => 1, 'max' => 12, 'step' => 1, ], ], 'size_units' => [ 'fr', 'custom' ], 'unit_selectors_dictionary' => [ 'custom' => '--e-con-grid-template-columns: {{SIZE}}', ], 'default' => [ 'unit' => 'fr', 'size' => 3, ], 'mobile_default' => [ 'unit' => 'fr', 'size' => 1, ], 'selectors' => [ '{{SELECTOR}}' => '--e-con-grid-template-columns: repeat({{SIZE}}, 1fr)', ], 'responsive' => true, 'frontend_available' => true, ] + $responsive_unit_defaults; $fields['rows_grid'] = [ 'label' => esc_html__( 'Rows', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'fr' => [ 'min' => 1, 'max' => 12, 'step' => 1, ], ], 'size_units' => [ 'fr', 'custom' ], 'unit_selectors_dictionary' => [ 'custom' => '--e-con-grid-template-rows: {{SIZE}}', ], 'default' => [ 'unit' => 'fr', 'size' => 2, ], 'selectors' => [ '{{SELECTOR}}' => '--e-con-grid-template-rows: repeat({{SIZE}}, 1fr)', ], 'responsive' => true, 'frontend_available' => true, ] + $responsive_unit_defaults; $fields['gaps'] = [ 'label' => esc_html__( 'Gaps', 'elementor' ), 'type' => Controls_Manager::GAPS, 'size_units' => [ 'px', '%', 'em', 'rem', 'vm', 'custom' ], 'default' => [ 'unit' => 'px', ], 'separator' => 'before', 'selectors' => [ '{{SELECTOR}}' => '--gap: {{ROW}}{{UNIT}} {{COLUMN}}{{UNIT}}', ], 'responsive' => true, ]; $fields['auto_flow'] = [ 'label' => esc_html__( 'Auto Flow', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'row' => esc_html__( 'Row', 'elementor' ), 'column' => esc_html__( 'Column', 'elementor' ), ], 'default' => 'row', 'separator' => 'before', 'selectors' => [ '{{SELECTOR}}' => '--grid-auto-flow: {{VALUE}}', ], 'responsive' => true, ]; $fields['justify_items'] = [ 'label' => esc_html_x( 'Justify Items', 'Grid Container Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'start' => [ 'title' => esc_html_x( 'Start', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-align-' . $icon_start . '-h', ], 'center' => [ 'title' => esc_html_x( 'Center', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-align-center-h', ], 'end' => [ 'title' => esc_html_x( 'End', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-align-' . $icon_end . '-h', ], 'stretch' => [ 'title' => esc_html_x( 'Stretch', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-align-stretch-h', ], ], 'default' => '', 'selectors' => [ '{{SELECTOR}}' => '--justify-items: {{VALUE}};', ], 'responsive' => true, ]; $fields['align_items'] = [ 'label' => esc_html_x( 'Align Items', 'Grid Container Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'start' => [ 'title' => esc_html_x( 'Start', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-align-start-v', ], 'center' => [ 'title' => esc_html_x( 'Center', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-align-center-v', ], 'end' => [ 'title' => esc_html_x( 'End', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-align-end-v', ], 'stretch' => [ 'title' => esc_html_x( 'Stretch', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-align-stretch-v', ], ], 'selectors' => [ '{{SELECTOR}}' => '--align-items: {{VALUE}};', ], 'responsive' => true, ]; $fields['justify_content'] = [ 'label' => esc_html_x( 'Justify Content', 'Grid Container Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'label_block' => true, 'default' => '', 'options' => [ 'start' => [ 'title' => esc_html_x( 'Start', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-start-h', ], 'center' => [ 'title' => esc_html_x( 'Middle', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-center-h', ], 'end' => [ 'title' => esc_html_x( 'End', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-end-h', ], 'space-between' => [ 'title' => esc_html_x( 'Space Between', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-space-between-h', ], 'space-around' => [ 'title' => esc_html_x( 'Space Around', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-space-around-h', ], 'space-evenly' => [ 'title' => esc_html_x( 'Space Evenly', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-space-evenly-h', ], ], 'selectors' => [ '{{SELECTOR}}' => '--grid-justify-content: {{VALUE}};', ], 'condition' => [ 'columns_grid[unit]' => 'custom', ], 'responsive' => true, ]; $fields['align_content'] = [ 'label' => esc_html_x( 'Align Content', 'Grid Container Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'label_block' => true, 'default' => '', 'options' => [ 'start' => [ 'title' => esc_html_x( 'Start', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-start-v', ], 'center' => [ 'title' => esc_html_x( 'Middle', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-center-v', ], 'end' => [ 'title' => esc_html_x( 'End', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-end-v', ], 'space-between' => [ 'title' => esc_html_x( 'Space Between', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-space-between-v', ], 'space-around' => [ 'title' => esc_html_x( 'Space Around', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-space-around-v', ], 'space-evenly' => [ 'title' => esc_html_x( 'Space Evenly', 'Grid Container Control', 'elementor' ), 'icon' => 'eicon-justify-space-evenly-v', ], ], 'selectors' => [ '{{SELECTOR}}' => '--grid-align-content: {{VALUE}};', ], 'condition' => [ 'rows_grid[unit]' => 'custom', ], 'responsive' => true, ]; // Only use the auto flow prefix class inside the editor. $auto_flow_prefix_class = Plugin::$instance->editor->is_edit_mode() ? [ 'prefix_class' => 'e-con--' ] : []; $fields['_is_row'] = array_merge( $auto_flow_prefix_class, [ 'type' => Controls_Manager::HIDDEN, 'default' => 'row', 'condition' => [ 'auto_flow' => [ 'row', ], ], ] ); $fields['_is_column'] = array_merge( $auto_flow_prefix_class, [ 'type' => Controls_Manager::HIDDEN, 'default' => 'column', 'condition' => [ 'auto_flow' => [ 'column', ], ], ] ); return $fields; } protected function get_responsive_unit_defaults() { $responsive_unit_defaults = []; $active_breakpoints = Plugin::$instance->breakpoints->get_active_breakpoints(); foreach ( $active_breakpoints as $breakpoint_name => $breakpoint ) { $responsive_unit_defaults[ $breakpoint_name . '_default' ] = [ 'unit' => 'fr', ]; } return $responsive_unit_defaults; } protected function get_default_options() { return [ 'popover' => false, ]; } } flex-container.php 0000666 00000017276 15165620442 0010221 0 ustar 00 <?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Group_Control_Flex_Container extends Group_Control_Base { protected static $fields; public static function get_type() { return 'flex-container'; } protected function init_fields() { $start = is_rtl() ? 'right' : 'left'; $end = is_rtl() ? 'left' : 'right'; $fields = []; $fields['items'] = [ 'type' => Controls_Manager::HEADING, 'label' => esc_html__( 'Items', 'elementor' ), 'separator' => 'before', ]; $fields['direction'] = [ 'label' => esc_html_x( 'Direction', 'Flex Container Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'row' => [ 'title' => esc_html_x( 'Row - horizontal', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-arrow-' . $end, ], 'column' => [ 'title' => esc_html_x( 'Column - vertical', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-arrow-down', ], 'row-reverse' => [ 'title' => esc_html_x( 'Row - reversed', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-arrow-' . $start, ], 'column-reverse' => [ 'title' => esc_html_x( 'Column - reversed', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-arrow-up', ], ], 'default' => '', // The `--container-widget-width` CSS variable is used for handling widgets that get an undefined width in column mode. // The `--container-widget-flex-grow` CSS variable is used to give certain widgets a default `flex-grow: 1` value for the `flex row` combination. 'selectors_dictionary' => [ 'row' => '--flex-direction: row; --container-widget-width: initial; --container-widget-height: 100%; --container-widget-flex-grow: 1; --container-widget-align-self: stretch;', 'column' => '--flex-direction: column; --container-widget-width: 100%; --container-widget-height: initial; --container-widget-flex-grow: 0; --container-widget-align-self: initial;', 'row-reverse' => '--flex-direction: row-reverse; --container-widget-width: initial; --container-widget-height: 100%; --container-widget-flex-grow: 1; --container-widget-align-self: stretch;', 'column-reverse' => '--flex-direction: column-reverse; --container-widget-width: 100%; --container-widget-height: initial; --container-widget-flex-grow: 0; --container-widget-align-self: initial;', ], 'selectors' => [ '{{SELECTOR}}' => '{{VALUE}};', ], 'responsive' => true, ]; // Only use the flex direction prefix class inside the editor. $flex_direction_prefix_class = Plugin::$instance->editor->is_edit_mode() ? [ 'prefix_class' => 'e-con--' ] : []; $fields['_is_row'] = array_merge( $flex_direction_prefix_class, [ 'type' => Controls_Manager::HIDDEN, 'default' => 'row', 'condition' => [ 'direction' => [ 'row', 'row-reverse', ], ], ] ); $fields['_is_column'] = array_merge( $flex_direction_prefix_class, [ 'type' => Controls_Manager::HIDDEN, 'default' => 'column', 'condition' => [ 'direction' => [ '', 'column', 'column-reverse', ], ], ] ); $fields['justify_content'] = [ 'label' => esc_html_x( 'Justify Content', 'Flex Container Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'label_block' => true, 'default' => '', 'options' => [ 'flex-start' => [ 'title' => esc_html_x( 'Start', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-justify-start-h', ], 'center' => [ 'title' => esc_html_x( 'Center', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-justify-center-h', ], 'flex-end' => [ 'title' => esc_html_x( 'End', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-justify-end-h', ], 'space-between' => [ 'title' => esc_html_x( 'Space Between', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-justify-space-between-h', ], 'space-around' => [ 'title' => esc_html_x( 'Space Around', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-justify-space-around-h', ], 'space-evenly' => [ 'title' => esc_html_x( 'Space Evenly', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-justify-space-evenly-h', ], ], 'selectors' => [ '{{SELECTOR}}' => '--justify-content: {{VALUE}};', ], 'responsive' => true, ]; $fields['align_items'] = [ 'label' => esc_html_x( 'Align Items', 'Flex Container Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'default' => '', 'options' => [ 'flex-start' => [ 'title' => esc_html_x( 'Start', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-align-start-v', ], 'center' => [ 'title' => esc_html_x( 'Center', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-align-center-v', ], 'flex-end' => [ 'title' => esc_html_x( 'End', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-align-end-v', ], 'stretch' => [ 'title' => esc_html_x( 'Stretch', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-align-stretch-v', ], ], 'selectors' => [ '{{SELECTOR}}' => '--align-items: {{VALUE}}; --container-widget-width: calc( ( 1 - var( --container-widget-flex-grow ) ) * 100% );', ], 'responsive' => true, ]; $fields['gap'] = [ 'label' => esc_html_x( 'Gap', 'Flex Item Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 500, ], '%' => [ 'min' => 0, 'max' => 100, ], 'vw' => [ 'min' => 0, 'max' => 100, ], 'em' => [ 'min' => 0, 'max' => 50, ], ], 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '{{SELECTOR}}' => '--gap: {{SIZE}}{{UNIT}};', ], 'responsive' => true, ]; $fields['wrap'] = [ 'label' => esc_html_x( 'Wrap', 'Flex Container Control', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'nowrap' => [ 'title' => esc_html_x( 'No Wrap', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-nowrap', ], 'wrap' => [ 'title' => esc_html_x( 'Wrap', 'Flex Container Control', 'elementor' ), 'icon' => 'eicon-flex eicon-wrap', ], ], 'description' => esc_html_x( 'Items within the container can stay in a single line (No wrap), or break into multiple lines (Wrap).', 'Flex Container Control', 'elementor' ), 'default' => '', 'selectors' => [ '{{SELECTOR}}' => '--flex-wrap: {{VALUE}};', ], 'responsive' => true, ]; $fields['align_content'] = [ 'label' => esc_html_x( 'Align Content', 'Flex Container Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => esc_html_x( 'Default', 'Flex Container Control', 'elementor' ), 'center' => esc_html_x( 'Center', 'Flex Container Control', 'elementor' ), 'flex-start' => esc_html_x( 'Flex Start', 'Flex Container Control', 'elementor' ), 'flex-end' => esc_html_x( 'Flex End', 'Flex Container Control', 'elementor' ), 'space-between' => esc_html_x( 'Space Between', 'Flex Container Control', 'elementor' ), 'space-around' => esc_html_x( 'Space Around', 'Flex Container Control', 'elementor' ), 'space-evenly' => esc_html_x( 'Space Evenly', 'Flex Container Control', 'elementor' ), ], 'selectors' => [ '{{SELECTOR}}' => '--align-content: {{VALUE}};', ], 'condition' => [ 'wrap' => 'wrap', ], 'responsive' => true, ]; return $fields; } protected function get_default_options() { return [ 'popover' => false, ]; } } image-size.php 0000666 00000026073 15165620442 0007330 0 ustar 00 <?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor image size control. * * A base control for creating image size control. Displays input fields to define * one of the default image sizes (thumbnail, medium, medium_large, large) or custom * image dimensions. * * @since 1.0.0 */ class Group_Control_Image_Size extends Group_Control_Base { /** * Fields. * * Holds all the image size control fields. * * @since 1.2.2 * @access protected * @static * * @var array Image size control fields. */ protected static $fields; /** * Get image size control type. * * Retrieve the control type, in this case `image-size`. * * @since 1.0.0 * @access public * @static * * @return string Control type. */ public static function get_type() { return 'image-size'; } /** * Get attachment image HTML. * * Retrieve the attachment image HTML code. * * Note that some widgets use the same key for the media control that allows * the image selection and for the image size control that allows the user * to select the image size, in this case the third parameter should be null * or the same as the second parameter. But when the widget uses different * keys for the media control and the image size control, when calling this * method you should pass the keys. * * @since 1.0.0 * @access public * @static * * @param array $settings Control settings. * @param string $image_size_key Optional. Settings key for image size. * Default is `image`. * @param string $image_key Optional. Settings key for image. Default * is null. If not defined uses image size key * as the image key. * * @return string Image HTML. */ public static function get_attachment_image_html( $settings, $image_size_key = 'image', $image_key = null ) { if ( ! $image_key ) { $image_key = $image_size_key; } $image = $settings[ $image_key ]; // Old version of image settings. if ( ! isset( $settings[ $image_size_key . '_size' ] ) ) { $settings[ $image_size_key . '_size' ] = ''; } $size = $settings[ $image_size_key . '_size' ]; $image_class = ! empty( $settings['hover_animation'] ) ? 'elementor-animation-' . $settings['hover_animation'] : ''; $html = ''; // If is the new version - with image size. $image_sizes = get_intermediate_image_sizes(); $image_sizes[] = 'full'; if ( ! empty( $image['id'] ) && ! wp_attachment_is_image( $image['id'] ) ) { $image['id'] = ''; } $is_static_render_mode = Plugin::$instance->frontend->is_static_render_mode(); // On static mode don't use WP responsive images. if ( ! empty( $image['id'] ) && in_array( $size, $image_sizes ) && ! $is_static_render_mode ) { $image_class .= " attachment-$size size-$size wp-image-{$image['id']}"; $image_attr = [ 'class' => trim( $image_class ), ]; $html .= wp_get_attachment_image( $image['id'], $size, false, $image_attr ); } else { $image_src = self::get_attachment_image_src( $image['id'], $image_size_key, $settings ); if ( ! $image_src && isset( $image['url'] ) ) { $image_src = $image['url']; } if ( ! empty( $image_src ) ) { $image_class_html = ! empty( $image_class ) ? ' class="' . $image_class . '"' : ''; $html .= sprintf( '<img src="%s" title="%s" alt="%s"%s loading="lazy" />', esc_attr( $image_src ), Control_Media::get_image_title( $image ), Control_Media::get_image_alt( $image ), $image_class_html ); } } /** * Get Attachment Image HTML * * Filters the Attachment Image HTML * * @since 2.4.0 * @param string $html the attachment image HTML string * @param array $settings Control settings. * @param string $image_size_key Optional. Settings key for image size. * Default is `image`. * @param string $image_key Optional. Settings key for image. Default * is null. If not defined uses image size key * as the image key. */ return apply_filters( 'elementor/image_size/get_attachment_image_html', $html, $settings, $image_size_key, $image_key ); } /** * Safe print attachment image HTML. * * @uses get_attachment_image_html. * * @access public * @static * * @param array $settings Control settings. * @param string $image_size_key Optional. Settings key for image size. * Default is `image`. * @param string $image_key Optional. Settings key for image. Default * is null. If not defined uses image size key * as the image key. */ public static function print_attachment_image_html( array $settings, $image_size_key = 'image', $image_key = null ) { Utils::print_wp_kses_extended( self::get_attachment_image_html( $settings, $image_size_key, $image_key ), [ 'image' ] ); } /** * Get all image sizes. * * Retrieve available image sizes with data like `width`, `height` and `crop`. * * @since 1.0.0 * @access public * @static * * @return array An array of available image sizes. */ public static function get_all_image_sizes() { global $_wp_additional_image_sizes; $default_image_sizes = [ 'thumbnail', 'medium', 'medium_large', 'large' ]; $image_sizes = []; foreach ( $default_image_sizes as $size ) { $image_sizes[ $size ] = [ 'width' => (int) get_option( $size . '_size_w' ), 'height' => (int) get_option( $size . '_size_h' ), 'crop' => (bool) get_option( $size . '_crop' ), ]; } if ( $_wp_additional_image_sizes ) { $image_sizes = array_merge( $image_sizes, $_wp_additional_image_sizes ); } /** This filter is documented in wp-admin/includes/media.php */ return apply_filters( 'image_size_names_choose', $image_sizes ); } /** * Get attachment image src. * * Retrieve the attachment image source URL. * * @since 1.0.0 * @access public * @static * * @param string $attachment_id The attachment ID. * @param string $image_size_key Settings key for image size. * @param array $settings Control settings. * * @return string Attachment image source URL. */ public static function get_attachment_image_src( $attachment_id, $image_size_key, array $settings ) { if ( empty( $attachment_id ) ) { return false; } $size = $settings[ $image_size_key . '_size' ]; if ( 'custom' !== $size ) { $attachment_size = $size; } else { // Use BFI_Thumb script // TODO: Please rewrite this code. require_once ELEMENTOR_PATH . 'includes/libraries/bfi-thumb/bfi-thumb.php'; $custom_dimension = $settings[ $image_size_key . '_custom_dimension' ]; $attachment_size = [ // Defaults sizes 0 => null, // Width. 1 => null, // Height. 'bfi_thumb' => true, 'crop' => true, ]; $has_custom_size = false; if ( ! empty( $custom_dimension['width'] ) ) { $has_custom_size = true; $attachment_size[0] = $custom_dimension['width']; } if ( ! empty( $custom_dimension['height'] ) ) { $has_custom_size = true; $attachment_size[1] = $custom_dimension['height']; } if ( ! $has_custom_size ) { $attachment_size = 'full'; } } $image_src = wp_get_attachment_image_src( $attachment_id, $attachment_size ); if ( empty( $image_src[0] ) && 'thumbnail' !== $attachment_size ) { $image_src = wp_get_attachment_image_src( $attachment_id ); } return ! empty( $image_src[0] ) ? $image_src[0] : ''; } /** * Get child default arguments. * * Retrieve the default arguments for all the child controls for a specific group * control. * * @since 1.2.2 * @access protected * * @return array Default arguments for all the child controls. */ protected function get_child_default_args() { return [ 'include' => [], 'exclude' => [], ]; } /** * Init fields. * * Initialize image size control fields. * * @since 1.2.2 * @access protected * * @return array Control fields. */ protected function init_fields() { $fields = []; $fields['size'] = [ 'label' => esc_html_x( 'Image Size', 'Image Size Control', 'elementor' ), 'type' => Controls_Manager::SELECT, ]; $fields['custom_dimension'] = [ 'label' => esc_html_x( 'Image Dimension', 'Image Size Control', 'elementor' ), 'type' => Controls_Manager::IMAGE_DIMENSIONS, 'description' => esc_html__( 'You can crop the original image size to any custom size. You can also set a single value for height or width in order to keep the original size ratio.', 'elementor' ), 'condition' => [ 'size' => 'custom', ], 'separator' => 'none', ]; return $fields; } /** * Prepare fields. * * Process image size control fields before adding them to `add_control()`. * * @since 1.2.2 * @access protected * * @param array $fields Image size control fields. * * @return array Processed fields. */ protected function prepare_fields( $fields ) { $image_sizes = $this->get_image_sizes(); $args = $this->get_args(); if ( ! empty( $args['default'] ) && isset( $image_sizes[ $args['default'] ] ) ) { $default_value = $args['default']; } else { // Get the first item for default value. $default_value = array_keys( $image_sizes ); $default_value = array_shift( $default_value ); } $fields['size']['options'] = $image_sizes; $fields['size']['default'] = $default_value; if ( ! isset( $image_sizes['custom'] ) ) { unset( $fields['custom_dimension'] ); } return parent::prepare_fields( $fields ); } /** * Get image sizes. * * Retrieve available image sizes after filtering `include` and `exclude` arguments. * * @since 2.0.0 * @access private * * @return array Filtered image sizes. */ private function get_image_sizes() { $wp_image_sizes = self::get_all_image_sizes(); $args = $this->get_args(); if ( $args['include'] ) { $wp_image_sizes = array_intersect_key( $wp_image_sizes, array_flip( $args['include'] ) ); } elseif ( $args['exclude'] ) { $wp_image_sizes = array_diff_key( $wp_image_sizes, array_flip( $args['exclude'] ) ); } $image_sizes = []; foreach ( $wp_image_sizes as $size_key => $size_attributes ) { $control_title = ucwords( str_replace( '_', ' ', $size_key ) ); if ( is_array( $size_attributes ) ) { $control_title .= sprintf( ' - %d x %d', $size_attributes['width'], $size_attributes['height'] ); } $image_sizes[ $size_key ] = $control_title; } $image_sizes['full'] = esc_html_x( 'Full', 'Image Size Control', 'elementor' ); if ( ! empty( $args['include']['custom'] ) || ! in_array( 'custom', $args['exclude'] ) ) { $image_sizes['custom'] = esc_html_x( 'Custom', 'Image Size Control', 'elementor' ); } return $image_sizes; } /** * Get default options. * * Retrieve the default options of the image size control. Used to return the * default options while initializing the image size control. * * @since 1.9.0 * @access protected * * @return array Default image size control options. */ protected function get_default_options() { return [ 'popover' => false, ]; } } text-shadow.php 0000666 00000003650 15165620442 0007541 0 ustar 00 <?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor text shadow control. * * A base control for creating text shadow control. Displays input fields to define * the text shadow including the horizontal shadow, vertical shadow, shadow blur and * shadow color. * * @since 1.6.0 */ class Group_Control_Text_Shadow extends Group_Control_Base { /** * Fields. * * Holds all the text shadow control fields. * * @since 1.6.0 * @access protected * @static * * @var array Text shadow control fields. */ protected static $fields; /** * Get text shadow control type. * * Retrieve the control type, in this case `text-shadow`. * * @since 1.6.0 * @access public * @static * * @return string Control type. */ public static function get_type() { return 'text-shadow'; } /** * Init fields. * * Initialize text shadow control fields. * * @since 1.6.0 * @access protected * * @return array Control fields. */ protected function init_fields() { $controls = []; $controls['text_shadow'] = [ 'label' => _x( 'Text Shadow', 'Text Shadow Control', 'elementor' ), 'type' => Controls_Manager::TEXT_SHADOW, 'selectors' => [ '{{SELECTOR}}' => 'text-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{COLOR}};', ], ]; return $controls; } /** * Get default options. * * Retrieve the default options of the text shadow control. Used to return the * default options while initializing the text shadow control. * * @since 1.9.0 * @access protected * * @return array Default text shadow control options. */ protected function get_default_options() { return [ 'popover' => [ 'starter_title' => _x( 'Text Shadow', 'Text Shadow Control', 'elementor' ), 'starter_name' => 'text_shadow_type', 'starter_value' => 'yes', 'settings' => [ 'render_type' => 'ui', ], ], ]; } } border.php 0000666 00000005314 15165620442 0006546 0 ustar 00 <?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor border control. * * A base control for creating border control. Displays input fields to define * border type, border width and border color. * * @since 1.0.0 */ class Group_Control_Border extends Group_Control_Base { /** * Fields. * * Holds all the border control fields. * * @since 1.0.0 * @access protected * @static * * @var array Border control fields. */ protected static $fields; /** * Get border control type. * * Retrieve the control type, in this case `border`. * * @since 1.0.0 * @access public * @static * * @return string Control type. */ public static function get_type() { return 'border'; } /** * Init fields. * * Initialize border control fields. * * @since 1.2.2 * @access protected * * @return array Control fields. */ protected function init_fields() { $fields = []; $fields['border'] = [ 'label' => esc_html_x( 'Border Type', 'Border Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__( 'Default', 'elementor' ), 'none' => esc_html__( 'None', 'elementor' ), 'solid' => esc_html_x( 'Solid', 'Border Control', 'elementor' ), 'double' => esc_html_x( 'Double', 'Border Control', 'elementor' ), 'dotted' => esc_html_x( 'Dotted', 'Border Control', 'elementor' ), 'dashed' => esc_html_x( 'Dashed', 'Border Control', 'elementor' ), 'groove' => esc_html_x( 'Groove', 'Border Control', 'elementor' ), ], 'selectors' => [ '{{SELECTOR}}' => 'border-style: {{VALUE}};', ], ]; $fields['width'] = [ 'label' => esc_html_x( 'Width', 'Border Control', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '{{SELECTOR}}' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'border!' => [ '', 'none' ], ], 'responsive' => true, ]; $fields['color'] = [ 'label' => esc_html_x( 'Color', 'Border Control', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{SELECTOR}}' => 'border-color: {{VALUE}};', ], 'condition' => [ 'border!' => [ '', 'none' ], ], ]; return $fields; } /** * Get default options. * * Retrieve the default options of the border control. Used to return the * default options while initializing the border control. * * @since 1.9.0 * @access protected * * @return array Default border control options. */ protected function get_default_options() { return [ 'popover' => false, ]; } } css-filter.php 0000666 00000007000 15165620442 0007336 0 ustar 00 <?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor CSS Filter control. * * A base control for applying css filters. Displays sliders to define the * values of different CSS filters including blur, brightens, contrast, * saturation and hue. * * @since 2.1.0 */ class Group_Control_Css_Filter extends Group_Control_Base { /** * Prepare fields. * * Process css_filter control fields before adding them to `add_control()`. * * @since 2.1.0 * @access protected * * @param array $fields CSS filter control fields. * * @return array Processed fields. */ protected static $fields; /** * Get CSS filter control type. * * Retrieve the control type, in this case `css-filter`. * * @since 2.1.0 * @access public * @static * * @return string Control type. */ public static function get_type() { return 'css-filter'; } /** * Init fields. * * Initialize CSS filter control fields. * * @since 2.1.0 * @access protected * * @return array Control fields. */ protected function init_fields() { $controls = []; $controls['blur'] = [ 'label' => esc_html_x( 'Blur', 'Filter Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'required' => 'true', 'range' => [ 'px' => [ 'min' => 0, 'max' => 10, 'step' => 0.1, ], ], 'default' => [ 'size' => 0, ], 'selectors' => [ '{{SELECTOR}}' => 'filter: brightness( {{brightness.SIZE}}% ) contrast( {{contrast.SIZE}}% ) saturate( {{saturate.SIZE}}% ) blur( {{blur.SIZE}}px ) hue-rotate( {{hue.SIZE}}deg )', ], ]; $controls['brightness'] = [ 'label' => esc_html_x( 'Brightness', 'Filter Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'render_type' => 'ui', 'required' => 'true', 'default' => [ 'size' => 100, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200, ], ], 'separator' => 'none', ]; $controls['contrast'] = [ 'label' => esc_html_x( 'Contrast', 'Filter Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'render_type' => 'ui', 'required' => 'true', 'default' => [ 'size' => 100, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200, ], ], 'separator' => 'none', ]; $controls['saturate'] = [ 'label' => esc_html_x( 'Saturation', 'Filter Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'render_type' => 'ui', 'required' => 'true', 'default' => [ 'size' => 100, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200, ], ], 'separator' => 'none', ]; $controls['hue'] = [ 'label' => esc_html_x( 'Hue', 'Filter Control', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'render_type' => 'ui', 'required' => 'true', 'default' => [ 'size' => 0, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 360, ], ], 'separator' => 'none', ]; return $controls; } /** * Get default options. * * Retrieve the default options of the CSS filter control. Used to return the * default options while initializing the CSS filter control. * * @since 2.1.0 * @access protected * * @return array Default CSS filter control options. */ protected function get_default_options() { return [ 'popover' => [ 'starter_name' => 'css_filter', 'starter_title' => esc_html_x( 'CSS Filters', 'Filter Control', 'elementor' ), 'settings' => [ 'render_type' => 'ui', ], ], ]; } } text-stroke.php 0000666 00000004747 15165620442 0007573 0 ustar 00 <?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor text stroke control. * * A group control for creating a stroke effect on text. Displays input fields to define * the text stroke and color stroke. * * @since 3.5.0 */ class Group_Control_Text_Stroke extends Group_Control_Base { /** * Fields. * * Holds all the text stroke control fields. * * @since 3.5.0 * @access protected * @static * * @var array Text Stroke control fields. */ protected static $fields; /** * Get text stroke control type. * * Retrieve the control type, in this case `text-stroke`. * * @since 3.5.0 * @access public * @static * * @return string Control type. */ public static function get_type() { return 'text-stroke'; } /** * Init fields. * * Initialize text stroke control fields. * * @since 3.5.0 * @access protected * * @return array Control fields. */ protected function init_fields() { $controls = []; $controls['text_stroke'] = [ 'label' => esc_html__( 'Text Stroke', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 10, ], 'em' => [ 'min' => 0, 'max' => 1, 'step' => 0.01, ], 'rem' => [ 'min' => 0, 'max' => 1, 'step' => 0.01, ], ], 'responsive' => true, 'selector' => '{{WRAPPER}}', 'selectors' => [ '{{SELECTOR}}' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}}; stroke-width: {{SIZE}}{{UNIT}};', ], ]; $controls['stroke_color'] = [ 'label' => esc_html__( 'Stroke Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#000', 'selector' => '{{WRAPPER}}', 'selectors' => [ '{{SELECTOR}}' => '-webkit-text-stroke-color: {{VALUE}}; stroke: {{VALUE}};', ], ]; return $controls; } /** * Get default options. * * Retrieve the default options of the text stroke control. Used to return the * default options while initializing the text stroke control. * * @since 3.5.0 * @access protected * * @return array Default text stroke control options. */ protected function get_default_options() { return [ 'popover' => [ 'starter_title' => esc_html_x( 'Text Stroke', 'Text Stroke Control', 'elementor' ), 'starter_name' => 'text_stroke_type', 'starter_value' => 'yes', 'settings' => [ 'render_type' => 'ui', ], ], ]; } } base.php 0000666 00000033655 15165620442 0006214 0 ustar 00 <?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor group control base. * * An abstract class for creating new group controls in the panel. * * @since 1.0.0 * @abstract */ abstract class Group_Control_Base implements Group_Control_Interface { /** * Arguments. * * Holds all the group control arguments. * * @access private * * @var array Group control arguments. */ private $args = []; /** * Options. * * Holds all the group control options. * * Currently supports only the popover options. * * @access private * * @var array Group control options. */ private $options; /** * Get options. * * Retrieve group control options. If options are not set, it will initialize default options. * * @since 1.9.0 * @access public * * @param array $option Optional. Single option. * * @return mixed Group control options. If option parameter was not specified, it will * return an array of all the options. If single option specified, it will * return the option value or `null` if option does not exists. */ final public function get_options( $option = null ) { if ( null === $this->options ) { $this->init_options(); } if ( $option ) { if ( isset( $this->options[ $option ] ) ) { return $this->options[ $option ]; } return null; } return $this->options; } /** * Add new controls to stack. * * Register multiple controls to allow the user to set/update data. * * @since 1.0.0 * @access public * * @param Controls_Stack $element The element stack. * @param array $user_args The control arguments defined by the user. * @param array $options Optional. The element options. Default is * an empty array. */ final public function add_controls( Controls_Stack $element, array $user_args, array $options = [] ) { $this->init_args( $user_args ); // Filter which controls to display $filtered_fields = $this->filter_fields(); $filtered_fields = $this->prepare_fields( $filtered_fields ); // For php < 7 reset( $filtered_fields ); if ( isset( $this->args['separator'] ) ) { $filtered_fields[ key( $filtered_fields ) ]['separator'] = $this->args['separator']; } $has_injection = false; if ( ! empty( $options['position'] ) ) { $has_injection = true; $element->start_injection( $options['position'] ); unset( $options['position'] ); } if ( $this->get_options( 'popover' ) ) { $this->start_popover( $element ); } foreach ( $filtered_fields as $field_id => $field_args ) { // Add the global group args to the control $field_args = $this->add_group_args_to_field( $field_id, $field_args ); // Register the control $id = $this->get_controls_prefix() . $field_id; if ( ! empty( $field_args['responsive'] ) ) { unset( $field_args['responsive'] ); $element->add_responsive_control( $id, $field_args, $options ); } else { $element->add_control( $id, $field_args, $options ); } } if ( $this->get_options( 'popover' ) ) { $element->end_popover(); } if ( $has_injection ) { $element->end_injection(); } } /** * Get arguments. * * Retrieve group control arguments. * * @since 1.0.0 * @access public * * @return array Group control arguments. */ final public function get_args() { return $this->args; } /** * Get fields. * * Retrieve group control fields. * * @since 1.2.2 * @access public * * @return array Control fields. */ final public function get_fields() { if ( null === static::$fields ) { static::$fields = $this->init_fields(); } return static::$fields; } /** * Get controls prefix. * * Retrieve the prefix of the group control, which is `{{ControlName}}_`. * * @since 1.0.0 * @access public * * @return string Control prefix. */ public function get_controls_prefix() { return $this->args['name'] . '_'; } /** * Get group control classes. * * Retrieve the classes of the group control. * * @since 1.0.0 * @access public * * @return string Group control classes. */ public function get_base_group_classes() { return 'elementor-group-control-' . static::get_type() . ' elementor-group-control'; } /** * Init fields. * * Initialize group control fields. * * @abstract * @since 1.2.2 * @access protected */ abstract protected function init_fields(); /** * Get default options. * * Retrieve the default options of the group control. Used to return the * default options while initializing the group control. * * @since 1.9.0 * @access protected * * @return array Default group control options. */ protected function get_default_options() { return []; } /** * Get child default arguments. * * Retrieve the default arguments for all the child controls for a specific group * control. * * @since 1.2.2 * @access protected * * @return array Default arguments for all the child controls. */ protected function get_child_default_args() { return []; } /** * Filter fields. * * Filter which controls to display, using `include`, `exclude` and the * `condition` arguments. * * @since 1.2.2 * @access protected * * @return array Control fields. */ protected function filter_fields() { $args = $this->get_args(); $fields = $this->get_fields(); if ( ! empty( $args['include'] ) ) { $fields = array_intersect_key( $fields, array_flip( $args['include'] ) ); } if ( ! empty( $args['exclude'] ) ) { $fields = array_diff_key( $fields, array_flip( $args['exclude'] ) ); } return $fields; } /** * Add group arguments to field. * * Register field arguments to group control. * * @since 1.2.2 * @access protected * * @param string $control_id Group control id. * @param array $field_args Group control field arguments. * * @return array */ protected function add_group_args_to_field( $control_id, $field_args ) { $args = $this->get_args(); if ( ! empty( $args['tab'] ) ) { $field_args['tab'] = $args['tab']; } if ( ! empty( $args['section'] ) ) { $field_args['section'] = $args['section']; } $field_args['classes'] = $this->get_base_group_classes() . ' elementor-group-control-' . $control_id; foreach ( [ 'condition', 'conditions' ] as $condition_type ) { if ( ! empty( $args[ $condition_type ] ) ) { if ( empty( $field_args[ $condition_type ] ) ) { $field_args[ $condition_type ] = []; } $field_args[ $condition_type ] += $args[ $condition_type ]; } } return $field_args; } /** * Prepare fields. * * Process group control fields before adding them to `add_control()`. * * @since 1.2.2 * @access protected * * @param array $fields Group control fields. * * @return array Processed fields. */ protected function prepare_fields( $fields ) { $popover_options = $this->get_options( 'popover' ); $popover_name = ! $popover_options ? null : $popover_options['starter_name']; foreach ( $fields as $field_key => &$field ) { if ( $popover_name ) { $field['condition'][ $popover_name . '!' ] = ''; } if ( isset( $this->args['fields_options']['__all'] ) ) { $field = array_merge( $field, $this->args['fields_options']['__all'] ); } if ( isset( $this->args['fields_options'][ $field_key ] ) ) { $field = array_merge( $field, $this->args['fields_options'][ $field_key ] ); } if ( ! empty( $field['condition'] ) ) { $field = $this->add_condition_prefix( $field ); } if ( ! empty( $field['conditions'] ) ) { $field['conditions'] = $this->add_conditions_prefix( $field['conditions'] ); } if ( ! empty( $field['selectors'] ) ) { $field['selectors'] = $this->handle_selectors( $field['selectors'] ); } if ( ! empty( $field['device_args'] ) ) { foreach ( $field['device_args'] as $device => $device_arg ) { if ( ! empty( $field['device_args'][ $device ]['condition'] ) ) { $field['device_args'][ $device ] = $this->add_condition_prefix( $field['device_args'][ $device ] ); } if ( ! empty( $field['device_args'][ $device ]['conditions'] ) ) { $field['device_args'][ $device ]['conditions'] = $this->add_conditions_prefix( $field['device_args'][ $device ]['conditions'] ); } if ( ! empty( $device_arg['selectors'] ) ) { $field['device_args'][ $device ]['selectors'] = $this->handle_selectors( $device_arg['selectors'] ); } } } } return $fields; } /** * Init options. * * Initializing group control options. * * @since 1.9.0 * @access private */ private function init_options() { $default_options = [ 'popover' => [ 'starter_name' => 'popover_toggle', 'starter_value' => 'custom', 'starter_title' => '', ], ]; $this->options = array_replace_recursive( $default_options, $this->get_default_options() ); } /** * Init arguments. * * Initializing group control base class. * * @since 1.2.2 * @access protected * * @param array $args Group control settings value. */ protected function init_args( $args ) { $this->args = array_merge( $this->get_default_args(), $this->get_child_default_args(), $args ); if ( isset( $this->args['scheme'] ) ) { $this->args['global']['default'] = Plugin::$instance->kits_manager->convert_scheme_to_global( $this->args['scheme'] ); } } /** * Get default arguments. * * Retrieve the default arguments of the group control. Used to return the * default arguments while initializing the group control. * * @since 1.2.2 * @access private * * @return array Control default arguments. */ private function get_default_args() { return [ 'default' => '', 'selector' => '{{WRAPPER}}', 'fields_options' => [], ]; } /** * Add condition prefix. * * Used to add the group prefix to controls with conditions, to * distinguish them from other controls with the same name. * * This way Elementor can apply condition logic to a specific control in a * group control. * * @since 1.2.0 * @access private * * @param array $field Group control field. * * @return array Group control field. */ private function add_condition_prefix( $field ) { $controls_prefix = $this->get_controls_prefix(); $prefixed_condition_keys = array_map( function( $key ) use ( $controls_prefix ) { return $controls_prefix . $key; }, array_keys( $field['condition'] ) ); $field['condition'] = array_combine( $prefixed_condition_keys, $field['condition'] ); return $field; } private function add_conditions_prefix( $conditions ) { $controls_prefix = $this->get_controls_prefix(); foreach ( $conditions['terms'] as & $condition ) { if ( isset( $condition['terms'] ) ) { $condition = $this->add_conditions_prefix( $condition ); continue; } $condition['name'] = $controls_prefix . $condition['name']; } return $conditions; } /** * Handle selectors. * * Used to process the CSS selector of group control fields. When using * group control, Elementor needs to apply the selector to different fields. * This method handles the process. * * In addition, it handles selector values from other fields and process the * css. * * @since 1.2.2 * @access private * * @param array $selectors An array of selectors to process. * * @return array Processed selectors. */ private function handle_selectors( $selectors ) { $args = $this->get_args(); $selectors = array_combine( array_map( function( $key ) use ( $args ) { return str_replace( '{{SELECTOR}}', $args['selector'], $key ); }, array_keys( $selectors ) ), $selectors ); if ( ! $selectors ) { return $selectors; } $controls_prefix = $this->get_controls_prefix(); foreach ( $selectors as &$selector ) { $selector = preg_replace_callback( '/{{\K(.*?)(?=}})/', function( $matches ) use ( $controls_prefix ) { $is_external_reference = false; return preg_replace_callback( '/[^ ]+?(?=\.)\./', function( $sub_matches ) use ( $controls_prefix, &$is_external_reference ) { $placeholder = $sub_matches[0]; if ( 'external.' === $placeholder ) { $is_external_reference = true; return ''; } if ( $is_external_reference ) { $is_external_reference = false; return $placeholder; } return $controls_prefix . $placeholder; }, $matches[1] ); }, $selector ); } return $selectors; } /** * Start popover. * * Starts a group controls popover. * * @since 1.9.1 * @access private * @param Controls_Stack $element Element. */ private function start_popover( Controls_Stack $element ) { $popover_options = $this->get_options( 'popover' ); $settings = $this->get_args(); if ( isset( $settings['global'] ) ) { if ( ! isset( $popover_options['settings']['global'] ) ) { $popover_options['settings']['global'] = []; } $popover_options['settings']['global'] = array_replace_recursive( $popover_options['settings']['global'], $settings['global'] ); } if ( isset( $settings['label'] ) ) { $label = $settings['label']; } else { $label = $popover_options['starter_title']; } $control_params = [ 'type' => Controls_Manager::POPOVER_TOGGLE, 'label' => $label, 'return_value' => $popover_options['starter_value'], ]; if ( ! empty( $popover_options['settings'] ) ) { $control_params = array_replace_recursive( $control_params, $popover_options['settings'] ); } foreach ( [ 'condition', 'conditions' ] as $key ) { if ( ! empty( $settings[ $key ] ) ) { $control_params[ $key ] = $settings[ $key ]; } } $starter_name = $popover_options['starter_name']; if ( isset( $this->args['fields_options'][ $starter_name ] ) ) { $control_params = array_merge( $control_params, $this->args['fields_options'][ $starter_name ] ); } $control_params['groupPrefix'] = $this->get_controls_prefix(); $element->add_control( $this->get_controls_prefix() . $starter_name, $control_params ); $element->start_popover(); } } box-shadow.php 0000666 00000004541 15165620442 0007345 0 ustar 00 <?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor box shadow control. * * A base control for creating box shadow control. Displays input fields to define * the box shadow including the horizontal shadow, vertical shadow, shadow blur, * shadow spread, shadow color and the position. * * @since 1.2.2 */ class Group_Control_Box_Shadow extends Group_Control_Base { /** * Fields. * * Holds all the box shadow control fields. * * @since 1.2.2 * @access protected * @static * * @var array Box shadow control fields. */ protected static $fields; /** * Get box shadow control type. * * Retrieve the control type, in this case `box-shadow`. * * @since 1.0.0 * @access public * @static * * @return string Control type. */ public static function get_type() { return 'box-shadow'; } /** * Init fields. * * Initialize box shadow control fields. * * @since 1.2.2 * @access protected * * @return array Control fields. */ protected function init_fields() { $controls = []; $controls['box_shadow'] = [ 'label' => esc_html_x( 'Box Shadow', 'Box Shadow Control', 'elementor' ), 'type' => Controls_Manager::BOX_SHADOW, 'selectors' => [ '{{SELECTOR}}' => 'box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{COLOR}} {{box_shadow_position.VALUE}};', ], ]; $controls['box_shadow_position'] = [ 'label' => esc_html_x( 'Position', 'Box Shadow Control', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ ' ' => esc_html_x( 'Outline', 'Box Shadow Control', 'elementor' ), 'inset' => esc_html_x( 'Inset', 'Box Shadow Control', 'elementor' ), ], 'default' => ' ', 'render_type' => 'ui', ]; return $controls; } /** * Get default options. * * Retrieve the default options of the box shadow control. Used to return the * default options while initializing the box shadow control. * * @since 1.9.0 * @access protected * * @return array Default box shadow control options. */ protected function get_default_options() { return [ 'popover' => [ 'starter_title' => esc_html_x( 'Box Shadow', 'Box Shadow Control', 'elementor' ), 'starter_name' => 'box_shadow_type', 'starter_value' => 'yes', 'settings' => [ 'render_type' => 'ui', ], ], ]; } }
| ver. 1.4 |
Github
|
.
| PHP 5.4.45 | Generation time: 0 |
proxy
|
phpinfo
|
Settings