| 1 |
<?php |
| 2 |
// Guard: block direct web access — only load when WordPress is bootstrapped. |
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
|
| 8 |
/** |
| 9 |
* Fired during plugin deactivation |
| 10 |
* |
| 11 |
* File role: defines the deactivation hook handler for the plugin. Registered as the |
| 12 |
* register_deactivation_hook() callback in mlsimport.php. Currently a no-op — all cleanup |
| 13 |
* (options/transients) is intentionally left commented out so settings survive deactivation. |
| 14 |
* |
| 15 |
* @link http://mlsimport.com/ |
| 16 |
* @since 1.0.0 |
| 17 |
* |
| 18 |
* @package Mlsimport |
| 19 |
* @subpackage Mlsimport/includes |
| 20 |
*/ |
| 21 |
|
| 22 |
/** |
| 23 |
* Fired during plugin deactivation. |
| 24 |
* |
| 25 |
* This class defines all code necessary to run during the plugin's deactivation. |
| 26 |
* |
| 27 |
* @since 1.0.0 |
| 28 |
* @package Mlsimport |
| 29 |
* @subpackage Mlsimport/includes |
| 30 |
* @author MlsImport <office@mlsimport.com> |
| 31 |
*/ |
| 32 |
class Mlsimport_Deactivator { |
| 33 |
|
| 34 |
|
| 35 |
/** |
| 36 |
* Run on plugin deactivation. |
| 37 |
* |
| 38 |
* Settings survive deactivation on purpose (re-activating keeps the user's |
| 39 |
* configuration), but the cached rewrite rules must not: the standalone |
| 40 |
* property archive rule would keep claiming its URL base with the plugin |
| 41 |
* off (#206). Deleting rewrite_rules makes WordPress rebuild them on the |
| 42 |
* next request, without this plugin's CPTs. The mode signature is deleted |
| 43 |
* too so Mlsimport_Standalone_Cpt::maybe_flush_rewrites() re-flushes on |
| 44 |
* the first init after a future re-activation. |
| 45 |
* |
| 46 |
* @since 1.0.0 |
| 47 |
* @return void |
| 48 |
*/ |
| 49 |
public static function deactivate() { |
| 50 |
delete_option( 'rewrite_rules' ); |
| 51 |
delete_option( 'mlsimport_rewrite_mode' ); |
| 52 |
} |
| 53 |
} |
| 54 |
|