WP Cron is not running
WP Cron is not running
WP Cron is not running
You just need to hook your function to the hook you named in the second parameter of wp_schedule_single_event function. See the following example: add_action(‘woo_kala_order_note_added’,’woo_kala_order_note’, 10, 2); function woo_kala_order_note( $comment_id, $kala_order_id ){ // do whatever your logic needs. }
Or, you could use WP-CLI which was developed for scenarios like these. After a short installation like this $ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar $ chmod +x wp-cli.phar $ sudo mv wp-cli.phar /usr/local/bin/wp You can run your scheduled tasks like so $ wp cron event run –due-now –path=/var/www/mywebsite.com/ or via crontab (every 5mins) */5 * * * … Read more
There is no downside for running WP CRON using the server’s cron jobs. In fact this is the recommended practice. According to Official WordPress Plugin Development Document: WP-Cron does not run continuously, which can be an issue if there are critical tasks that must run on time. There is an easy solution for this. Simply … Read more
I haven’t tested this, but if you don’t want to use WP-CLI and ONLY want to use crontab tasks, you would have to add new crontab job for each subsite, like: curl -s https://example.com/[directory]/wp-cron.php > /dev/null 2>&1 Ref: https://vpsfix.com/7456/setup-proper-cron-jobs-wordpress-multisite-network/ You said your crons are not working for subfolders, but you don’t provide any error messages … Read more
I was hoping that I’d get more community feedback, but overall based on my research, the best option was to create a separate image of my application using the same code based, specifically tailored to run wp-cli, using the built-in crond service to ensure that the crons were running according to a proper cron schedule. … Read more
WP Cron based on array list
What are scheduled callbacks?
Is there a technical difference between invoking `wp-cron.php` and using `wp cron event run`?
Action to create custom field based on shipping class works when manually triggered, but not on cron schedule