Compare time value in WP_User_Query for sending emails
Compare time value in WP_User_Query for sending emails
Compare time value in WP_User_Query for sending emails
For future reference if someone else has the same problem. Found out that the high availability of the database cluster was causing this. For some weird reason another server was sending old data back to the mysql server on which this wordpress site is connected at the moment. The strange thing is that it was … Read more
Adding $args to wp_schedule_event() causes hook to add infinitely to WP Cron
Certain functions are not available when executed with wp_schedule_event
Might be your production server still uses the site url of the dev server? Check your production database for dev url’s. In any case, use the WP_SITEURL and WP_HOME defines
The core functions needs to be called within the WordPress environment only. The cron.php is out of it thus resulting in that Call to undefined function error. Easiest way to the solution of your problem is to move the contents on that file in the mct_task() function.
Add this to the functions.php file of your active (child) theme- add_action( ‘init’, ‘wpse_393267_activate_plugin’ ); function wpse_393267_activate_plugin() { if( !function_exists( ‘is_plugin_active’ ) ) { include_once ABSPATH . ‘/wp-admin/includes/plugin.php’; } $plugin_to_activate=”jetpack/jetpack.php”; // plugin-dir/plugin-file.php $date_to_activate=”2021-08-13″; // YYYY-MM-DD if( is_plugin_active( $plugin_to_activate ) ) return; if( time() >= strtotime( $date_to_activate ) ) { activate_plugin( $plugin_to_activate ); } } Change … Read more
I will recommend to not use wp cron since will require someone to visit the website. Read more here about cron jobs. In case you want with wp-cron here is what you need: Create 10 minutes interval in your schedules if you dont have one. add_filter( ‘cron_schedules’, function ( $schedules ) { $schedules[‘every_ten_minutes’] = array( … Read more
This code will call your function every hour. // The ‘if’ condition is needed to make sure the scheduler runs only once if ( ! wp_next_scheduled( ‘my_custom_action’ ) ){ wp_schedule_event( time(), ‘hourly’, ‘my_custom_action’ ); } // Here we create our own action to attach to the scheduler add_action( ‘my_custom_action’, ‘update_content’ ); It is also recommended … Read more
WordPress cron not getting executed when called by external service (but ok from browser)