Ecommerce Shopify WordPress Discussion

WP-Cron based on array list

I've never used WP Cron in my life and I'm struggling with a task. I have the following array: $times = array(10:00, 15:00, 21:00); I need to schedule this times so I can call the enable_update() this is the function: function enable_update(){ $GLOBALS['cron'] = true; } Thanks in advance for any help! Something that I tried:
If you are planning to add a specific event to be executed on a given time on WP Cron, you may need to use one of the below functions to set it up: Single Event: https://developer.wordpress.org/reference/functions/wp_schedule_single_event/ Recurring Event: https://developer.wordpress.org/reference/functions/wp_schedule_event/ You could use those functions to set up the events, and then WP Cron would run them according to the scheduled time. // Schedule the event to run daily. if ( ! wp_next_scheduled( 'my_cron_hook' ) ) { wp_schedule_event( time(), 'daily', 'my_cron_hook' ); } // Add the action to be executed daily. function my_cron_function() { // Do whatever you need. } add_action( 'my_cron_hook', 'my_cron_function' ); Hope that helps!

February 26, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.