url.php in Redirection 2.7.2, at actions/url.php
| 1 | <?php |
| 2 | |
| 3 | class Url_Action extends Red_Action { |
| 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 ) { |
| 18 | $redirect = wp_redirect( $target, $code ); |
| 19 | if ( $redirect ) { |
| 20 | die(); |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 |