| 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 |
|