Replies: 0
Cron is not visible in neither in WP Crontrol plugin nor in database.
I checked Woocommerce->settings and in wordpress environment section I can see that WordPress CRON is enabled.
This is the code i added to my child’s theme functions.php:
if ( ! wp_next_scheduled( 'popup_cron_hook' ) ) {
wp_schedule_event( time(), 'every_minute', 'popup_cron_hook' );
}
add_action( 'popup_cron_hook', 'popup_cron_hook_ex' );
function popup_cron_hook_ex(){
$options = get_random_brand_images(6);
update_option('popuplt_popular_brands', $options, false);
}
every_minute schedule is added in woocommerce action-scheduler class by authors:
public function add_wp_cron_schedule( $schedules ) {
$schedules['every_minute'] = array(
'interval' => 60, // in seconds
'display' => __( 'Every minute', 'woocommerce' ),
);
Why my cron is not working?