# copy-the-code/3.4.2/classes/class-helpers.php

Copy Anything to Clipboard for WordPress – Copy Button, Copy Text &amp; Copy Code, version 3.4.2. 738 lines.

- Page: https://pluginprobe.com/plugins/copy-the-code/3.4.2/code/classes/class-helpers.php
- Raw: https://pluginprobe.com/plugins/copy-the-code/3.4.2/raw/classes/class-helpers.php
- Modified: 2023-12-05T21:12:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/copy-the-code/3.4.2/code/classes/class-helpers.php#L10-L20`.

```php
<?php
/**
 * Helpers
 *
 * @package Copy the Code
 * @since 1.0.0
 */

namespace CopyTheCode;

use Elementor\Controls_Manager;
use Elementor\Group_Control_Background;
use Elementor\Group_Control_Typography;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;

/**
 * Helpers
 *
 * @since 1.0.0
 */
class Helpers {
    public static function get_svg_copy_icon() {
        return '<svg aria-hidden="true" focusable="false" role="img" class="copy-icon" viewBox="0 0 16 16" width="16" height="16" fill="currentColor"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg>';
    }

    public static function get_svg_checked_icon() {
        return '<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="check-icon" fill="currentColor"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg>';
    }

    public static function get_copy_button( $args = [] ) {
        $show_icon = isset( $args['show_icon'] ) ? $args['show_icon'] : 'yes';
        $with_icon = 'yes' === $show_icon ? 'with-icon' : 'without-icon';
        $as_raw = isset( $args['as_raw'] ) ? 'yes' : '';
        $button_text = isset( $args['button_text'] ) ? $args['button_text'] : esc_html__( 'Copy', 'copy-the-code' );
        $button_class = isset( $args['button_class'] ) ? $args['button_class'] : '';
        $button_text_copied = isset( $args['button_text_copied'] ) ? $args['button_text_copied'] : esc_html__( 'Copied!', 'copy-the-code' );
        $icon_direction = isset( $args['icon_direction'] ) ? $args['icon_direction'] : 'before';

        ob_start();
        ?>
        <button class="ctc-block-copy ctc-<?php echo esc_attr( $with_icon ); ?>" copy-as-raw='<?php echo esc_html( $as_raw ); ?>' data-copied="<?php echo esc_html( $button_text_copied ); ?>">
            <?php
            if ( 'before' === $icon_direction && 'yes' === $show_icon ) {
                echo self::get_svg_copy_icon();
                echo self::get_svg_checked_icon();
            }
            echo '<span class="ctc-button-text">' . esc_html( $button_text ) . '</span>';
            if ( 'after' === $icon_direction && 'yes' === $show_icon ) {
                echo self::get_svg_copy_icon();
                echo self::get_svg_checked_icon();
            }
            ?>
        </button>
        <?php
        return ob_get_clean();
    }

    /**
     * Is shortcode used
     * 
     * @param string $shortcode
     * @since 3.1.0
     */
    public static function is_shortcode_used( $shortcode = '' ) {
        global $post;
        if ( ! $post ) {
            return false;
        }

        $found = false;
        if ( has_shortcode( $post->post_content, $shortcode ) ) {
            $found = true;
        }

        return $found;
    }

    /**
     * Get categories
     * 
     * @since 3.2.0
     */
    public static function get_categories() {
        return [ 'copy-the-code', 'basic' ];
    }

    /**
     * Get common keywords
     * 
     * @param array $keywords New keywords.
     * @since 3.2.0
     */
    public static function get_keywords( $keywords = [] ) {
        $default = [ 'copy', 'paste', 'clipboard', 'copy clipboard', 'copy to clipboard', 'copy anything to clipboard' ];

        return array_merge( $default, $keywords );
    }

    /**
     * Register "Copy Content" Section
     * 
     * @param object $self
     */
    public static function register_copy_content_section( $self, $args = [] ) {
        $self->start_controls_section(
            'copy_content_section',
            [
                'label' => esc_html__( 'Hidden Copy Content', 'copy-the-code' ),
            ]
        );

        if ( isset( $args['before_controls'] ) ) {
            foreach ( $args['before_controls'] as $control_id => $options ) {
                $self->add_control( $control_id, $options );
            }
        }

        $self->add_control(
            'copy_content',
            [
                'label' => isset( $args[ 'label' ] ) ? $args[ 'label' ] : esc_html__( 'Enter Text that Copy to Clipboard', 'copy-the-code' ),
                'type' => Controls_Manager::TEXTAREA,
                'default' => isset( $args[ 'default' ] ) ? $args[ 'default' ] : '',
                'rows' => 10,
            ]
        );

        if ( isset( $args['after_controls'] ) ) {
            foreach ( $args['after_controls'] as $control_id => $options ) {
                $self->add_control( $control_id, $options );
            }
        }

        $self->end_controls_section();
    }

    /**
     * Register "Copy Button" Section
     * 
     * @param array $args
     * @param object $self
     */
    public static function register_copy_button_section( $self, $args = [] ) {
        $default = [
            'button_text' => isset( $args[ 'button_text' ] ) ? $args[ 'button_text' ] : esc_html__( 'Copy to Clipboard', 'copy-the-code' ),
            'button_text_copied' => isset( $args[ 'button_text_copied' ] ) ? $args[ 'button_text_copied' ] : esc_html__( 'Copied!', 'copy-the-code' ),
            'show_icon' => 'yes',
            'icon_direction' => 'before',
        ];

        $self->start_controls_section(
            'copy_button_section',
            [
                'label' => esc_html__( 'Copy Button', 'copy-the-code' ),
            ]
        );
        
        $self->add_control(
            'copy_button_text',
            [
                'label' => esc_html__( 'Button Text', 'copy-the-code' ),
                'type' => Controls_Manager::TEXT,
                'default' => $default[ 'button_text' ],
            ]
        );

        $self->add_control(
            'copy_button_text_copied',
            [
                'label' => esc_html__( 'After Copy Text', 'copy-the-code' ),
                'type' => Controls_Manager::TEXT,
                'default' => $default[ 'button_text_copied' ],
            ]
        );

        // Alignment.
        $self->add_responsive_control(
            'copy_button_align',
            [
                'label' => esc_html__( 'Alignment', 'copy-the-code' ),
                'type' => Controls_Manager::CHOOSE,
                'options' => [
                    'left' => [
                        'title' => esc_html__( 'Left', 'copy-the-code' ),
                        'icon' => 'eicon-text-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__( 'Center', 'copy-the-code' ),
                        'icon' => 'eicon-text-align-center',
                    ],
                    'right' => [
                        'title' => esc_html__( 'Right', 'copy-the-code' ),
                        'icon' => 'eicon-text-align-right',
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .ctc-block-actions' => 'text-align: {{VALUE}};',
                ],
            ]
        );

        // Show Icon.
        $self->add_control(
            'copy_show_icon',
            [
                'label' => esc_html__( 'Show Icon', 'copy-the-code' ),
                'type' => Controls_Manager::SWITCHER,
                'label_on' => esc_html__( 'Show', 'copy-the-code' ),
                'label_off' => esc_html__( 'Hide', 'copy-the-code' ),
                'return_value' => 'yes',
                'default' => 'yes',
            ]
        );

        $self->add_control(
            'copy_icon_direction',
            [
                'label' => esc_html__( 'Icon Direction', 'copy-the-code' ),
                'type' => Controls_Manager::SELECT,
                'default' => 'before',
                'options' => [
                    'before' => esc_html__( 'Before', 'copy-the-code' ),
                    'after' => esc_html__( 'After', 'copy-the-code' ),
                ],
                'condition' => [
                    'copy_show_icon' => 'yes',
                ],
            ]
        );

        $self->add_responsive_control(
            'copy_icon_text_gap',
            [
                'label' => esc_html__( 'Icon and Text Gap', 'copy-the-code' ),
                'type' => Controls_Manager::SLIDER,
                'size_units' => [ 'px', 'em' ],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                    'em' => [
                        'min' => 0,
                        'max' => 10,
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .ctc-with-icon' => 'gap: {{SIZE}}{{UNIT}};',
                ],
                'condition' => [
                    'copy_show_icon' => 'yes',
                ],
            ]
        );

        $self->end_controls_section();
    }

    /**
     * Register "Copy Button Style" Section
     * 
     * @param object $self
     */
    public static function register_copy_button_style_section( $self ) {
        self::register_style_section( $self, 'Copy Button', '.ctc-block-copy', [
            'text_align' => false,
            'normal_text_color' => [
                'selectors' => [
                    '{{WRAPPER}} .ctc-block-copy' => 'color: {{VALUE}};',
					'{{WRAPPER}} .ctc-block-copy svg' => 'fill: {{VALUE}};',
                ]
            ],
            'hover_text_color' => [
                'selectors' => [
                    '{{WRAPPER}} .ctc-block-copy:hover' => 'color: {{VALUE}};',
                    '{{WRAPPER}} .ctc-block-copy:hover svg' => 'fill: {{VALUE}};',
                ]
            ],
        ] );
    }

    /**
     * Render "Copy Button"
     * 
     * @param object $self
     */
    public static function render_copy_button( $self ) {
        $button_text = $self->get_settings_for_display( 'copy_button_text' );
        $button_text_copied = $self->get_settings_for_display( 'copy_button_text_copied' );
        $show_icon = $self->get_settings_for_display( 'copy_show_icon' );
        $icon_direction = $self->get_settings_for_display( 'copy_icon_direction' );

        echo Helpers::get_copy_button( [
            'as_raw' => 'yes',
            'button_text' => $button_text,
            'button_text_copied' => $button_text_copied,
            'icon_direction' => $icon_direction,
            'show_icon' => $show_icon,
        ] );
    }

    /**
     * Render "Copy Content"
     * 
     * @param object $self
     * @param array $args
     */
    public static function render_copy_content( $self, $args = [] ) {
        $content = isset( $args[ 'content' ] ) ? $args[ 'content' ] : $self->get_settings_for_display( 'copy_content' );
        ?>
        <textarea class="ctc-copy-content" style="display: none;"><?php echo wp_kses_post( apply_shortcodes( $content ) ); ?></textarea>
        <?php
    }

    /**
     * Register "Get Pro" Section
     * 
     * @param object $self
     * @param array $args
     */
    public static function register_pro_section( $self, $label ) {
        $id = str_replace( ' ', '-', $label );
        $id = strtolower( $id );

        $self->start_controls_section(
			$id . '_box',
			[
				'label' => $label . ' (Pro)',
				'tab' => Controls_Manager::TAB_STYLE,
			]
		);

        // Buy pro.
        $self->add_control(
            $id . '_box_content',
            [
                'type' => Controls_Manager::RAW_HTML,
                'raw' => '<div style="text-align: center;"><h2 style="font-weight: 600;margin: 0 0 10px 0;font-size: 14px;">Unlock Premium Features!</h2><p style="margin: 0 0 10px 0;">Upgrade to Clipboard Pro for enhanced functionality and exclusive benefits.</p><p style="margin: 0 0 10px 0;">Ready to level up your experience?</p><a href="https://clipboard.agency/#pricing" class="button button-primary" target="_blank">See Pricing Plans</a></div>',
            ]
        );

        $self->end_controls_section();
    }

    /**
     * Register "Get Pro" Sections
     * 
     * @param object $self
     * @param array $labels
     */
    public static function register_pro_sections( $self, $labels = [] ) {
        foreach ( $labels as $label ) {
            self::register_pro_section( $self, $label );
        }
    }

    /**
	 * Register normal and hover styles.
     * 
     * @param object $self
     * @param string $label
     * @param array $args
	 */
	public static function register_style_section( $self, $label = '', $selector = '', $args = [] ) {
        $id = 'reusable-' . sanitize_title_with_dashes( $label );

        $size = isset( $args[ 'size' ] ) ? $args[ 'size' ] : false;
        $text_decoration = isset( $args[ 'text_decoration' ] ) ? $args[ 'text_decoration' ] : false;
        $margin = isset( $args[ 'margin' ] ) ? $args[ 'margin' ] : true;
        $padding = isset( $args[ 'padding' ] ) ? $args[ 'padding' ] : true;
        $border = isset( $args[ 'border' ] ) ? $args[ 'border' ] : false; // Disabled.
        $border_radius = isset( $args[ 'border_radius' ] ) ? $args[ 'border_radius' ] : true;
        $background = isset( $args[ 'background' ] ) ? $args[ 'background' ] : false; // Disabled.
        $text_color = isset( $args[ 'text_color' ] ) ? $args[ 'text_color' ] : false; // Disabled.
        $typography = isset( $args[ 'typography' ] ) ? $args[ 'typography' ] : true;
        $text_align = isset( $args[ 'text_align' ] ) ? $args[ 'text_align' ] : true;
        $box_shadow = isset( $args[ 'box_shadow' ] ) ? $args[ 'box_shadow' ] : false; // Disabled.
        $tabs = isset( $args[ 'tabs' ] ) ? $args[ 'tabs' ] : true;
        $normal_background = isset( $args[ 'normal_background' ] ) ? $args[ 'normal_background' ] : true;
        $normal_text_color = isset( $args[ 'normal_text_color' ] ) ? $args[ 'normal_text_color' ] : true;
        $normal_typography = isset( $args[ 'normal_typography' ] ) ? $args[ 'normal_typography' ] : false; // Disabled.
        $normal_border = isset( $args[ 'normal_border' ] ) ? $args[ 'normal_border' ] : true;
        $normal_box_shadow = isset( $args[ 'normal_box_shadow' ] ) ? $args[ 'normal_box_shadow' ] : true;

        // Section.
		$self->start_controls_section(
			$id . '_style_section',
			[
				'label' => $label,
				'tab'   => Controls_Manager::TAB_STYLE,
			]
		);

        if ( $margin ) :
            $self->add_responsive_control(
                $id . '_margin',
                array(
                    'label'      => esc_html__( 'Margin', 'copy-the-code' ),
                    'type'       => Controls_Manager::DIMENSIONS,
                    'size_units' => array( 'px', 'em', '%' ),
                    'selectors'  => array(
                        '{{WRAPPER}} ' . $selector => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ),
                )
            );
        endif;

        if ( $padding ) :
            $self->add_responsive_control(
                $id . '_padding',
                array(
                    'label'      => esc_html__( 'Padding', 'copy-the-code' ),
                    'type'       => Controls_Manager::DIMENSIONS,
                    'size_units' => array( 'px', 'em', '%' ),
                    'selectors'  => array(
                        '{{WRAPPER}} ' . $selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ),
                )
            );
        endif;

        if ( $border ) :
            $border_selector = '{{WRAPPER}} ' . $selector;
            if ( isset( $args[ 'border' ] ) && is_array( $args[ 'border' ] ) ) {
                if ( isset( $args[ 'border' ][ 'selector' ] ) ) {
                    $border_selector = $args[ 'border' ][ 'selector' ];
                }
            }
            $self->add_group_control(
                \Elementor\Group_Control_Border::get_type(),
                [
                    'name'     => $id . '_border',
                    'selector' => $border_selector,
                ]
            );
        endif;

        if ( $border_radius ) :
            $self->add_responsive_control(
                $id . '_border_radius',
                array(
                    'label'      => esc_html__( 'Border Radius', 'copy-the-code' ),
                    'type'       => Controls_Manager::DIMENSIONS,
                    'size_units' => array( 'px', '%' ),
                    'selectors'  => array(
                        '{{WRAPPER}} ' . $selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ),
                )
            );
        endif;

        if ( $background ) :
            $self->add_group_control(
                \Elementor\Group_Control_Background::get_type(),
                [
                    'name' => $id . '_background',
                    'types'  => [ 'classic', 'gradient' ],
                    'exclude'  => [ 'image', 'video' ],
                    'selector' => '{{WRAPPER}} ' . $selector,
                ]
            );
        endif;

        if ( $text_color ) :
            $self->add_control(
                $id . '_text_color',
                [
                    'label'     => esc_html__( 'Text Color', 'copy-the-code' ),
                    'type'      => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} ' . $selector => 'color: {{VALUE}};',
                    ],
                ]
            );
        endif;

        if ( $typography ) :
            $self->add_group_control(
                \Elementor\Group_Control_Typography::get_type(),
                [
                    'name'     => $id . '_typography',
                    'selector' => '{{WRAPPER}} ' . $selector,
                ]
            );
        endif;

        if ( $size ) :
            $size_label = esc_html__( 'Width', 'copy-the-code' );
            $size_selectors = [
                '{{WRAPPER}} ' . $selector => 'width: {{SIZE}}{{UNIT}};',
            ];
            if ( isset( $args[ 'size' ] ) && is_array( $args[ 'size' ] ) ) {
                if ( isset( $args[ 'size' ][ 'selectors' ] ) ) {
                    $size_selectors = $args[ 'size' ][ 'selectors' ];
                }
                if ( isset( $args[ 'size' ][ 'label' ] ) ) {
                    $size_label = $args[ 'size' ][ 'label' ];
                }
            }

            $self->add_responsive_control(
                $id . '_size',
                [
                    'label' => $size_label,
                    'type' => Controls_Manager::SLIDER,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => $size_selectors,
                ]
            );
        endif;

        if ( $text_decoration ) :
            $text_decoration_selectors = [
                '{{WRAPPER}} ' . $selector => 'text-decoration: {{VALUE}};',
            ];
            if ( isset( $args[ 'text_decoration' ] ) && is_array( $args[ 'text_decoration' ] ) ) {
                if ( isset( $args[ 'text_decoration' ][ 'selectors' ] ) ) {
                    $text_decoration_selectors = $args[ 'text_decoration' ][ 'selectors' ];
                }
            }

            $self->add_control(
                $id . '_text_decoration',
                [
                    'label' => esc_html__( 'Text Decoration', 'copy-the-code' ),
                    'type' => Controls_Manager::SELECT,
                    'options' => [
                        'none' => esc_html__( 'None', 'copy-the-code' ),
                        'underline' => esc_html__( 'Underline', 'copy-the-code' ),
                        'overline' => esc_html__( 'Overline', 'copy-the-code' ),
                        'line-through' => esc_html__( 'Line Through', 'copy-the-code' ),
                    ],
                    'selectors' => $text_decoration_selectors,
                ]
            );
        endif;

        if ( $text_align ) :
            $self->add_responsive_control(
                $id . '_text_align',
                [
                    'label' => esc_html__( 'Alignment', 'copy-the-code' ),
                    'type' => Controls_Manager::CHOOSE,
                    'options' => [
                        'left' => [
                            'title' => esc_html__( 'Left', 'copy-the-code' ),
                            'icon' => 'eicon-text-align-left',
                        ],
                        'center' => [
                            'title' => esc_html__( 'Center', 'copy-the-code' ),
                            'icon' => 'eicon-text-align-center',
                        ],
                        'right' => [
                            'title' => esc_html__( 'Right', 'copy-the-code' ),
                            'icon' => 'eicon-text-align-right',
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} ' . $selector => 'text-align: {{VALUE}};',
                    ],
                ]
            );
        endif;

        if ( $box_shadow ) :
            $self->add_group_control(
                \Elementor\Group_Control_Box_Shadow::get_type(),
                [
                    'name'     => $id . '_box_shadow',
                    'selector' => '{{WRAPPER}} ' . $selector,
                ]
            );
        endif;

        if ( $tabs ) :
            // Tabs.
            $self->start_controls_tabs(
                $id . '_style_tabs'
            );

            // Normal.
            $self->start_controls_tab(
                $id . '_style_normal_tab',
                [
                    'label' => esc_html__( 'Normal', 'copy-the-code' ),
                ]
            );

            if ( $normal_background ) :
                $self->add_group_control(
                    \Elementor\Group_Control_Background::get_type(),
                    [
                        'name' => $id . '_normal_background',
                        'types'  => [ 'classic', 'gradient' ],
                        'exclude'  => [ 'image', 'video' ],
                        'selector' => '{{WRAPPER}} ' . $selector,
                    ]
                );
            endif;

            if ( $normal_text_color ) :
                $normal_text_color_label = esc_html__( 'Text Color', 'copy-the-code' );
                $normal_text_color_selectors = [
                    '{{WRAPPER}} ' . $selector => 'color: {{VALUE}};',
                ];
                if ( isset( $args[ 'normal_text_color' ] ) && is_array( $args[ 'normal_text_color' ] ) ) {
                    if ( isset( $args[ 'normal_text_color' ][ 'selectors' ] ) ) {
                        $normal_text_color_selectors = $args[ 'normal_text_color' ][ 'selectors' ];
                    }
                    if ( isset( $args[ 'normal_text_color' ][ 'label' ] ) ) {
                        $normal_text_color_label = $args[ 'normal_text_color' ][ 'label' ];
                    }
                }
                $self->add_control(
                    $id . '_normal_text_color',
                    [
                        'label'     => $normal_text_color_label,
                        'type'      => Controls_Manager::COLOR,
                        'selectors' => $normal_text_color_selectors,
                    ]
                );
            endif;

            if ( $normal_typography ) :
                $self->add_group_control(
                    \Elementor\Group_Control_Typography::get_type(),
                    [
                        'name'     => $id . '_normal_typography',
                        'selector' => '{{WRAPPER}} ' . $selector,
                    ]
                );
            endif;

            if ( $normal_border ) :
                $self->add_group_control(
                    \Elementor\Group_Control_Border::get_type(),
                    [
                        'name'     => $id . '_normal_border',
                        'default'  => 'red',
                        'selector' => '{{WRAPPER}} ' . $selector,
                    ]
                );
            endif;

            if ( $normal_box_shadow ) :
                $self->add_group_control(
                    \Elementor\Group_Control_Box_Shadow::get_type(),
                    [
                        'name'     => $id . '_normal_box_shadow',
                        'selector' => '{{WRAPPER}} ' . $selector,
                    ]
                );
            endif;

            $self->end_controls_tab();
            // Normal End.

            // Hover.
            $self->start_controls_tab(
                $id . '_style_hover_tab',
                [
                    'label' => esc_html__( 'Hover', 'copy-the-code' ),
                ]
            );

            if ( $normal_background ) :
                $self->add_group_control(
                    \Elementor\Group_Control_Background::get_type(),
                    [
                        'name'     => $id . '_hover_background',
                        'types'    => [ 'classic', 'gradient' ],
                        'exclude'  => [ 'image' ],
                        'selector' => '{{WRAPPER}} ' . $selector . ':hover',
                    ]
                );
            endif;

            if ( $normal_text_color ) :

                $hover_text_color_label = esc_html__( 'Text Color', 'copy-the-code' );
                $hover_text_color_selectors = [
                    '{{WRAPPER}} ' . $selector => 'color: {{VALUE}};',
                ];
                if ( isset( $args[ 'hover_text_color' ] ) && is_array( $args[ 'hover_text_color' ] ) ) {
                    if ( isset( $args[ 'hover_text_color' ][ 'selectors' ] ) ) {
                        $hover_text_color_selectors = $args[ 'hover_text_color' ][ 'selectors' ];
                    }
                    if ( isset( $args[ 'hover_text_color' ][ 'label' ] ) ) {
                        $hover_text_color_label = $args[ 'hover_text_color' ][ 'label' ];
                    }
                }

                $self->add_control(
                    $id . '_hover_text_color',
                    array(
                        'label'     => $hover_text_color_label,
                        'type'      => Controls_Manager::COLOR,
                        'selectors' => $hover_text_color_selectors,
                    )
                );
            endif;

            if ( $normal_border ) :
                $self->add_control(
                    $id . '_hover_border',
                    array(
                        'label'     => esc_html__( 'Border Color', 'copy-the-code' ),
                        'type'      => Controls_Manager::COLOR,
                        'selectors' => array(
                            '{{WRAPPER}} ' . $selector . ':hover' => 'border-color: {{VALUE}};',
                        ),
                    )
                );
            endif;

            if ( $normal_box_shadow ) :
                $self->add_group_control(
                    \Elementor\Group_Control_Box_Shadow::get_type(),
                    array(
                        'name'     => $id . '_hover_box_shadow',
                        'selector' => '{{WRAPPER}} ' . $selector . ':hover',
                    )
                );
            endif;

            $self->end_controls_tab();
            // Hover End.

            $self->end_controls_tabs();
            // Tabs.
        endif;

        $self->end_controls_section();
		// Section End.
	}

}
```
