if ($checkout_status) { add_filter('edd_after_checkout_cart', 'edd_rp_display_checkout'); } $this->determine_cron_schedule(); } public function define_custom_scripts() { wp_register_style('edd-rp-styles', EDD_RP_PLUGIN_URL . 'css/style.css', NULL, EDD_RP_VERSION, 'all'); wp_enqueue_style('edd-rp-styles'); } /* * determine_cron_schedule * * Is used to figure out if our cron is already determined and then adds the hook for updating the suggestion stats */ public function determine_cron_schedule() { if (!wp_next_scheduled('edd_rp_suggestions')) { $next_run = strtotime('23:00') + -(get_option('gmt_offset') * 60 * 60); // Calc for the WP timezone if ((int) date_i18n('G') >= 23) { $next_run = strtotime('next day 23:00') + -(get_option('gmt_offset') * 60 * 60); } // Calc for the WP timezone; wp_schedule_event($next_run, 'daily', 'edd_rp_suggestions'); } add_action('edd_rp_suggestions', 'edd_rp_generate_stats'); } } $edd_rp_loaded = EDDRecommendedDownloads::getInstance();
function edd_rp_load_plugin() { $edd_rp_loaded = EDDRecommendedDownloads::getInstance(); }