Sometimes during testing you want the post expiration cron to run at very short intervals, but no short interval is available in the CRED editor. To enable custom cron intervals, add the following code to functions.php:
/* --------------------------------------------- */ // CUSTOM POST EXPIRATION CRON INTERVALS add_filter ('cred_post_expiration_cron_schedules', 'my_cred_post_exp_cron_func', 10,1); function my_cred_post_exp_cron_func ($schedules) { $schedules['onemin'] = array( 'interval' => MINUTE_IN_SECONDS, 'display' => __( 'Every Minute' ) ); $schedules['twomin'] = array( 'interval' => 2 * MINUTE_IN_SECONDS, 'display' => __( 'Every 2 Minutes' ) ); return $schedules; }
Add or remove custom intervals as needed.
Let us know if this snippet is not working for you:
This snippet doesn’t work