Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where in Wordpress DB are stored wp_cron tasks?

Tags:

cron

wordpress

I was looking in wp_options table but there is nothing like that eventhough I have set my cron tasks like:

add_action('init', function() {     if ( !wp_next_scheduled('my_awesome_cron_hook') ) {         wp_schedule_event(time(), 'hourly', 'my_awesome_cron_hook');     } }); 

Or is it stored in some txt file in wordpress?

like image 780
Derfder Avatar asked May 18 '13 20:05

Derfder


People also ask

How do I find my cron jobs in WordPress?

View and Control WordPress Cron System Upon activation, you need to visit Tools » Cron Events page to control cron settings. You will see a list of all cron events scheduled to run on your site using the WordPress cron system. In the first column, you will see the name of the hook that runs the cron.

How does cron work in WordPress?

WP-Cron works by checking, on every page load, a list of scheduled tasks to see what needs to be run. Any tasks due to run will be called during that page load. WP-Cron does not run constantly as the system cron does; it is only triggered on page load.

Where is WP cron php?

WordPress uses a wp-cron. php file, located in the root directory of your website, as a virtual cron job. It's a scheduled task to automate processes like publishing scheduled posts, checking for plugin or theme updates, sending email notifications, etc.


1 Answers

It's stored in the database inside wp_options under the option_name cron.

You can get the array with: _get_cron_array() or get_option('cron').

See: http://core.trac.wordpress.org/browser/trunk/wp-includes/cron.php

like image 156
MarZab Avatar answered Oct 20 '22 14:10

MarZab