| 1 |
<?php |
| 2 |
|
| 3 |
include_once dirname( __FILE__ ).'/modules/wordpress.php'; |
| 4 |
|
| 5 |
class Redirection { |
| 6 |
private static $instance = null; |
| 7 |
private $module; |
| 8 |
|
| 9 |
static function init() { |
| 10 |
if ( is_null( self::$instance ) ) { |
| 11 |
self::$instance = new Redirection(); |
| 12 |
} |
| 13 |
|
| 14 |
return self::$instance; |
| 15 |
} |
| 16 |
|
| 17 |
public function __construct() { |
| 18 |
$this->module = Red_Module::get( WordPress_Module::MODULE_ID ); |
| 19 |
$this->module->start(); |
| 20 |
|
| 21 |
add_action( Red_Flusher::DELETE_HOOK, array( $this, 'clean_redirection_logs' ) ); |
| 22 |
} |
| 23 |
|
| 24 |
public function clean_redirection_logs() { |
| 25 |
$flusher = new Red_Flusher(); |
| 26 |
$flusher->flush(); |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
add_action( 'plugins_loaded', array( 'Redirection', 'init' ) ); |
| 31 |
|