| @@ -1,0 +1,25 @@ | ||
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace Templately; | |
| 4 | + | |
| 5 | +class Installer { | |
| 6 | + // For activate the plugin | |
| 7 | + public static function activate( $network_wide ) { | |
| 8 | + flush_rewrite_rules(); | |
| 9 | + if ( is_multisite() && $network_wide ) { | |
| 10 | + return; | |
| 11 | + } | |
| 12 | + set_transient( 'templately_activation_redirect', true, MINUTE_IN_SECONDS ); | |
| 13 | + } | |
| 14 | + | |
| 15 | + public static function deactivate() { | |
| 16 | + // For deactivate the plugin | |
| 17 | + } | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * Init. | |
| 21 | + */ | |
| 22 | + public static function init() { | |
| 23 | + register_activation_hook( TEMPLATELY_FILE, [ __CLASS__, 'activate' ] ); | |
| 24 | + } | |
| 25 | +} | |