| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin activation handler. |
| 4 |
* |
| 5 |
* Defines Mlsimport_Activator, whose static activate() runs on plugin activation |
| 6 |
* (registered via register_activation_hook in mlsimport.php). It clears the cached |
| 7 |
* plugin data schema transient and creates the plugin's activity tracking table. |
| 8 |
* |
| 9 |
* @package MLSImport |
| 10 |
*/ |
| 11 |
// Abort if the file is accessed directly outside of WordPress. |
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; // Exit if accessed directly |
| 14 |
} |
| 15 |
|
| 16 |
|
| 17 |
/** |
| 18 |
* Fired during plugin activation |
| 19 |
* |
| 20 |
* @link http://mlsimport.com/ |
| 21 |
* @since 1.0.0 |
| 22 |
* |
| 23 |
* @package Mlsimport |
| 24 |
* @subpackage Mlsimport/includes |
| 25 |
*/ |
| 26 |
|
| 27 |
/** |
| 28 |
* Fired during plugin activation. |
| 29 |
* |
| 30 |
* This class defines all code necessary to run during the plugin's activation. |
| 31 |
* |
| 32 |
* @since 1.0.0 |
| 33 |
* @package Mlsimport |
| 34 |
* @subpackage Mlsimport/includes |
| 35 |
* @author MlsImport <office@mlsimport.com> |
| 36 |
*/ |
| 37 |
class Mlsimport_Activator { |
| 38 |
|
| 39 |
|
| 40 |
/** |
| 41 |
* Short Description. (use period) |
| 42 |
* |
| 43 |
* Long Description. |
| 44 |
* |
| 45 |
* Runs once on plugin activation: clears the cached plugin-data schema transient |
| 46 |
* and ensures the activity tracking table exists. |
| 47 |
* |
| 48 |
* @since 1.0.0 |
| 49 |
* @return void |
| 50 |
*/ |
| 51 |
public static function activate() { |
| 52 |
// Drop any stale cached schema so it is rebuilt fresh. |
| 53 |
delete_transient( 'mlsimport_plugin_data_schema' ); |
| 54 |
// Create (or update) the activity tracking table. |
| 55 |
mlsimport_create_activity_table(); |
| 56 |
} |
| 57 |
} |
| 58 |
|