<?php if ( ! defined( 'ABSPATH' ) ) { exit(); } /** * LD Notifications Update class */ class LD_Notifications_Update { public function __construct() { add_action( 'init', array( $this, 'update_plugin_cron_shcedule' ) ); } /** * Update plugin cron schedule for each plugin update */ public function update_plugin_cron_shcedule() { $saved_version = get_option( 'ld_notifications_version' ); $current_version = LEARNDASH_NOTIFICATIONS_VERSION; if ( $saved_version === false || version_compare( $saved_version, $current_version, '<' ) ) { wp_clear_scheduled_hook( 'learndash_notifications_cron' ); wp_clear_scheduled_hook( 'learndash_notifications_cron_hourly' ); if ( ! wp_next_scheduled( 'learndash_notifications_cron' ) ) { wp_schedule_event( time(), 'twicedaily', 'learndash_notifications_cron' ); } //queue this for kick start the check if ( ! wp_next_scheduled( 'leanrdash_notifications_send_delayed_email' ) ) { wp_schedule_single_event( time(), 'leanrdash_notifications_send_delayed_email' ); } update_option( 'learndash_notifications_drips_check', true ); update_option( 'ld_notifications_version', $current_version ); update_option( 'ld_notifications_init', time() ); } } } new LD_Notifications_Update;
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
admin | Folder | 0755 |
|
|
activation.php | File | 426 B | 0644 |
|
ajax.php | File | 4.34 KB | 0644 |
|
class-dependency-check.php | File | 240 B | 0644 |
|
cron.php | File | 2.6 KB | 0644 |
|
database.php | File | 10.61 KB | 0644 |
|
deactivation.php | File | 304 B | 0644 |
|
functions.php | File | 1.82 KB | 0644 |
|
logger.php | File | 2.05 KB | 0644 |
|
meta-box.php | File | 31.46 KB | 0644 |
|
notification.php | File | 79.16 KB | 0644 |
|
post-type.php | File | 12.03 KB | 0644 |
|
shortcode.php | File | 12.09 KB | 0644 |
|
subscription-manager.php | File | 4.69 KB | 0644 |
|
tools.php | File | 4.2 KB | 0644 |
|
update.php | File | 1.25 KB | 0644 |
|
user.php | File | 1.61 KB | 0644 |
|