| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Fired during plugin deactivation |
| 5 |
* |
| 6 |
* @link https://plugins360.com |
| 7 |
* @since 1.0.0 |
| 8 |
* |
| 9 |
* @package Automatic_YouTube_Gallery |
| 10 |
*/ |
| 11 |
|
| 12 |
// Exit if accessed directly |
| 13 |
if ( ! defined( 'WPINC' ) ) { |
| 14 |
die; |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* AYG_Deactivator class. |
| 19 |
* |
| 20 |
* @since 1.0.0 |
| 21 |
*/ |
| 22 |
class AYG_Deactivator { |
| 23 |
|
| 24 |
/** |
| 25 |
* Called when the plugin is deactivated. |
| 26 |
* |
| 27 |
* @since 1.0.0 |
| 28 |
*/ |
| 29 |
public static function deactivate() { |
| 30 |
// Clear the plugin's scheduled cron events so they don't keep firing while the |
| 31 |
// plugin is inactive. |
| 32 |
if ( wp_next_scheduled( 'ayg_schedule_weekly' ) ) { |
| 33 |
wp_clear_scheduled_hook( 'ayg_schedule_weekly' ); |
| 34 |
} |
| 35 |
|
| 36 |
if ( wp_next_scheduled( 'ayg_cron_schedule' ) ) { |
| 37 |
wp_clear_scheduled_hook( 'ayg_cron_schedule' ); |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
} |
| 42 |
|