| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if ( ! defined( 'ABSPATH' ) ) |
| 4 |
exit; |
| 5 |
|
| 6 |
/** |
| 7 |
* WPSight_Install class |
| 8 |
*/ |
| 9 |
class WPSight_Install { |
| 10 |
|
| 11 |
/** |
| 12 |
* Constructor |
| 13 |
*/ |
| 14 |
public function __construct() { |
| 15 |
$this->cron(); |
| 16 |
delete_transient( 'wpsight_addons_html' ); |
| 17 |
delete_transient( 'wpsight_themes_html' ); |
| 18 |
update_option( 'wpsight_version', WPSIGHT_VERSION ); |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* cron() |
| 23 |
* |
| 24 |
* Setup custom cron jobs |
| 25 |
* |
| 26 |
* @uses wp_clear_scheduled_hook() |
| 27 |
* @uses wp_schedule_event() |
| 28 |
* |
| 29 |
* @since 1.0.0 |
| 30 |
*/ |
| 31 |
public function cron() { |
| 32 |
|
| 33 |
// Handle delete previews cron |
| 34 |
wp_clear_scheduled_hook( 'wpsight_delete_listing_previews' ); |
| 35 |
wp_schedule_event( time(), 'daily', 'wpsight_delete_listing_previews' ); |
| 36 |
|
| 37 |
} |
| 38 |
|
| 39 |
} |
| 40 |
|
| 41 |
new WPSight_Install(); |
| 42 |
|