PluginProbe
Redirection / 2.7
Redirection v2.7
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
← All changes | actions/url.php +14 -11 4.22.7 View file →
@@ -1,20 +1,23 @@
1 1 <?php
2 2
3 3 class Url_Action extends Red_Action {
4 - protected function redirect_to( $code, $target ) {
4 + function can_change_code() {
5 + return true;
6 + }
7 +
8 + function action_codes() {
9 + return array(
10 + 301 => get_status_header_desc( 301 ),
11 + 302 => get_status_header_desc( 302 ),
12 + 307 => get_status_header_desc( 307 ),
13 + 308 => get_status_header_desc( 308 ),
14 + );
15 + }
16 +
17 + function process_before( $code, $target ) {
5 18 $redirect = wp_redirect( $target, $code );
6 -
7 19 if ( $redirect ) {
8 - header( 'X-Redirect-Agent: redirection' );
9 20 die();
10 21 }
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 22 }
20 23 }