| Server IP : 178.212.43.201 / Your IP : 10.100.0.33 Web Server : Apache/2.4.37 (Oracle Linux Server) OpenSSL/1.1.1k System : Linux spa0007.srv.paxillus.pl 5.4.17-2136.355.3.1.el8uek.x86_64 #3 SMP Sat May 9 17:11:55 PDT 2026 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/kontur_dev/wp-content/plugins/redirection/actions/ |
Upload File : |
<?php
/**
* URL action - redirect to a URL
*/
class Url_Action extends Red_Action {
/**
* Redirect to a URL
*
* @param string $target Target URL.
* @return void
*/
protected function redirect_to( $target ) {
// This is a known redirect, possibly extenal
// phpcs:ignore
$redirect = wp_redirect( $target, $this->get_code(), 'redirection' );
if ( $redirect ) {
/** @psalm-suppress InvalidGlobal */
global $wp_version;
if ( version_compare( $wp_version, '5.1', '<' ) ) {
header( 'X-Redirect-Agent: redirection' );
}
die();
}
}
/**
* Run this action. May not return from this function.
*
* @return void
*/
public function run() {
$target = $this->get_target();
if ( $target !== null ) {
$this->redirect_to( $target );
}
}
/**
* Does this action need a target?
*
* @return boolean
*/
public function needs_target() {
return true;
}
public function name() {
return __( 'Redirect to URL', 'redirection' );
}
}