PluginProbe
Redirection / 4.1
Redirection v4.1
5.10.0 5.9.0 5.8.1 5.8.0 3.7.2 3.7.3 4.0 4.0.1 4.1 4.1.1 4.2 4.2.1 4.2.2 4.2.3 4.3 4.3.1 4.3.2 4.3.3 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6.2 4.7.1 All 130 releases
redirection / actions / url.php

url.php in Redirection 4.1, at actions/url.php

21 lines 377 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Url_Action extends Red_Action {
4 protected function redirect_to( $code, $target ) {
5 $redirect = wp_redirect( $target, $code );
6
7 if ( $redirect ) {
8 header( 'X-Redirect-Agent: redirection' );
9 die();
10 }
11 }
12
13 public function process_after( $code, $target ) {
14 $this->redirect_to( $code, $target );
15 }
16
17 public function needs_target() {
18 return true;
19 }
20 }
21