s_media_query', [ 'label' => __('Parallax Start From', 'bdthemes-element-pack'), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __('All Device', 'bdthemes-element-pack'), '@xl' => __('Retina to Larger', 'bdthemes-element-pack'), '@l' => __('Desktop to Larger', 'bdthemes-element-pack'), '@m' => __('Tablet to Larger', 'bdthemes-element-pack'), '@s' => __('Mobile to Larger', 'bdthemes-element-pack'), ], 'condition' => [ 'ep_parallax_effects_show' => 'yes', ], 'render_type' => 'none', 'frontend_available' => true, //'separator' => 'after', ] ); $widget->add_control( 'ep_parallax_effects_target', [ 'label' => __('Target', 'bdthemes-element-pack') . BDTEP_NC, 'type' => Controls_Manager::SELECT, 'default' => 'self', 'options' => [ 'self' => __('Self', 'bdthemes-element-pack'), 'section' => __('Section', 'bdthemes-element-pack'), ], 'condition' => [ 'ep_parallax_effects_show' => 'yes', ], 'render_type' => 'none', 'frontend_available' => true, 'separator' => 'after', ] ); } public function section_parallax_effects_before_render($widget) { $settings = $widget->get_settings_for_display(); if ( $settings['ep_parallax_effects_show'] == 'yes' ) { wp_enqueue_script('ep-parallax-effects'); } } protected function add_actions() { add_action('elementor/element/section/section_effects/after_section_start', [$this, 'register_widget_control'], 10, 11); add_action('elementor/element/column/section_effects/after_section_start', [$this, 'register_widget_control'], 10, 11); add_action('elementor/element/common/section_effects/after_section_start', [$this, 'register_widget_control'], 10, 11); add_action('elementor/frontend/section/before_render', [$this, 'section_parallax_effects_before_render'], 10, 1); add_action('elementor/frontend/widget/before_render', [$this, 'section_parallax_effects_before_render'], 10, 1); } }