| Server IP : 43.130.17.34 / Your IP : 216.73.217.6 Web Server : nginx/1.28.0 System : Linux VM-4-12-opencloudos 6.6.92-34.1.oc9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 25 21:32:13 CST 2025 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/yespkg.com/wp-content/plugins/elementor-pro/modules/forms/actions/ |
Upload File : |
<?php
namespace ElementorPro\Modules\Forms\Actions;
use Elementor\Controls_Manager;
use Elementor\Modules\DynamicTags\Module as TagsModule;
use ElementorPro\Modules\Forms\Classes\Action_Base;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Redirect extends Action_Base {
public function get_name() {
return 'redirect';
}
public function get_label() {
return esc_html__( 'Redirect', 'elementor-pro' );
}
public function register_settings_section( $widget ) {
$widget->start_controls_section(
'section_redirect',
[
'label' => esc_html__( 'Redirect', 'elementor-pro' ),
'condition' => [
'submit_actions' => $this->get_name(),
],
]
);
$widget->add_control(
'redirect_to',
[
'label' => esc_html__( 'Redirect To', 'elementor-pro' ),
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( 'https://your-link.com', 'elementor-pro' ),
'ai' => [
'active' => false,
],
'dynamic' => [
'active' => true,
'categories' => [
TagsModule::POST_META_CATEGORY,
TagsModule::TEXT_CATEGORY,
TagsModule::URL_CATEGORY,
],
],
'label_block' => true,
'render_type' => 'none',
'classes' => 'elementor-control-direction-ltr',
]
);
$widget->end_controls_section();
}
public function on_export( $element ) {
unset(
$element['settings']['redirect_to']
);
return $element;
}
public function run( $record, $ajax_handler ) {
$redirect_to = $record->get_form_settings( 'redirect_to' );
$redirect_to = $record->replace_setting_shortcodes( $redirect_to, true );
$redirect_to = esc_url_raw( $redirect_to );
if ( ! empty( $redirect_to ) && filter_var( $redirect_to, FILTER_VALIDATE_URL ) ) {
$ajax_handler->add_response_data( 'redirect_url', $redirect_to );
}
}
}