| Server IP : 172.67.201.108 / Your IP : 216.73.217.39 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /ourscripts/essential-addons-for-elementor-lite/includes/Extensions/ |
Upload File : |
<?php
namespace Essential_Addons_Elementor\Extensions;
use Elementor\Controls_Manager;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Wrapper_Link {
/**
* Initialize hooks
*/
public function __construct() {
add_action( 'elementor/element/common/_section_style/after_section_end', [ $this, 'register_controls' ] );
add_action( 'elementor/element/column/section_advanced/after_section_end', [ $this, 'register_controls' ] );
add_action( 'elementor/element/section/section_advanced/after_section_end', [ $this, 'register_controls' ] );
add_action( 'elementor/element/container/section_layout/after_section_end', [ $this, 'register_controls' ] );
add_action( 'elementor/frontend/before_render', [ $this, 'before_render' ], 1 );
}
public function register_controls( $element ) {
$element->start_controls_section(
'eael_wrapper_link_section',
[
'label' => __( '<i class="eaicon-logo"></i> Wrapper Link', 'essential-addons-for-elementor-lite' ),
'tab' => Controls_Manager::TAB_ADVANCED
]
);
$element->add_control(
'eael_wrapper_link_switch',
[
'label' => __( 'Enable Wrapper Link', 'essential-addons-for-elementor-lite' ),
'type' => Controls_Manager::SWITCHER
]
);
$element->add_control(
'eael_wrapper_link',
[
'label' => __( 'Link', 'essential-addons-for-elementor-lite' ),
'type' => Controls_Manager::URL,
'dynamic' => [
'active' => true,
],
'condition' => [
'eael_wrapper_link_switch!' => ''
]
]
);
$element->end_controls_section();
}
public function before_render( $element ) {
$wrapper_link_settings = $element->get_settings_for_display( 'eael_wrapper_link' );
if ( ! empty( $element->get_settings_for_display( 'eael_wrapper_link_switch' ) ) && ! empty( $wrapper_link_settings['url'] ) ) {
unset( $wrapper_link_settings['custom_attributes'] );
$element->add_render_attribute( '_wrapper',
'data-eael-wrapper-link',
wp_json_encode( $wrapper_link_settings )
);
}
}
}