| Server IP : 3.93.235.159 / Your IP : 216.73.216.140 Web Server : Apache System : Linux ip-172-26-0-169 5.10.0-46-cloud-amd64 #1 SMP Debian 5.10.262-1 (2026-07-31) x86_64 User : bitnami ( 1000) PHP Version : 8.2.9 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/hello-plus/modules/forms/actions/ |
Upload File : |
<?php
namespace HelloPlus\Modules\Forms\Actions;
use HelloPlus\Modules\Forms\Classes\Action_Base;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Redirect extends Action_Base {
public function get_name(): string {
return 'ehp-redirect';
}
public function get_label(): string {
return esc_html__( 'Redirect', 'hello-plus' );
}
public function register_settings_section( $widget ) {
}
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' );
if ( empty( $redirect_to ) ) {
return;
}
$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 );
}
}
}