Unfortunately, you cannot run script on every 12 December. WP Cron can be only defined as interval from first execution of script, so you have to execute script on 12 December with one year interval to do exactly what you want.
I will suggest you to create WP Cron job with daily interval and check in script if today is 12 December.
if (!wp_next_scheduled('my_task_hook')) {
wp_schedule_event(time(), 'daily', 'my_task_hook');
}
add_action('my_task_hook', 'my_task_function');
function my_task_function() {
$today = strtotime(date());
if (date('d', $today) == '12' && date('m', $today) == '12') {
// today is 12 December!
}
}
Related Posts:
- Should I disable WP_CRON and instead trigger wp-cron.php from server every few mins?
- Do WordPress cron jobs slow down page loading?
- PHP Warning on fresh install (Connection timed out)
- Is there a known vulnerability for wp-cron.php?
- WordPress cron isn’t scheduled on amazon web services
- Using wp_schedule_single_event with arguments to send email
- wp_schedule_event is executing but the function related to the hook is not running
- How to use wp_schedule_event in a class?
- wp_schedule_event won’t accept args
- add_action to wp cron?
- Run WP Cron Weekly (but on a certain day)
- Get frequency of scheduled event
- wp_schedule_event() on specific time, daily
- wp_next_scheduled returning a past timestamp
- Do wp-cron scheduled tasks run asynchronously?
- Some rogue WordPress plugin killing my server – how do I isolate and kill it?
- Why?: hundreds of empty files named wp-cron.php?doing_wp_cron.
- Can’t access wp_filesystem in cron function
- WP CRON runs only the first time
- Run a cron job (or similar) in the background of WP after post update/create
- wp-cron still running even though DISABLE_WP_CRON is true
- How to set up WP Cron in this scenario
- Where in the page load code is wp-cron triggered?
- WP-Cron tasks scheduled but not running
- wp_get_schedule and wp_next_scheduled don’t find my scheduled wp-cron job
- Getting Error “invalid secret string” by running wp-cron.php manually
- Why cron doesn’t work to me?
- Wp cron event is set but the function isn’t getting fired
- Is doing_wp_cron a necessary query string when scheduling cron.php as a cron job?
- Run a php file daily at specific time
- Scheduling posts on wordpress adds wrong seconds as post_date
- WordPress Cron is scheduled but not running
- How to make WordPress emails async
- How to execute existing WP Cron programmatically
- Cleaning “cron” from options table, will affect anything?
- Execute code at the end of each quarter of year
- debugging wp_cron jobs with XDebug in Eclipse
- wp_schedule_event run in background or not?
- Cron schedule not updating after run
- How to schedule and publish a post after it’s ready?
- wp-cron.php – timeout
- Failed to open stream: HTTP request failed! in \wamp\www\wordpress\wp-includes\class-http.php on line 929
- How could an event previously scheduled with wp_schedule_event later become unscheduled?
- daily wp_schedule_event hook works after reload any page
- update post every day
- WP Cron jobs loops infinitely
- Sync user meta fields using Wp cron job
- wp-cron behaviour when there are multiple queued tasks
- WordPress action hooks related to scheduled posts not Fired
- Cron job not working – Can’t see in the queue attached
- “Missed schedule” posting bug
- How to force ‘cron_schedules’ every minute instead 1 hour?
- When running WordPress Cron manually, it shows WP-Cron spawning is disabled. What is WP-Cron spawning?
- Cron job to run just once per day using external cron service
- How to know if a script started by wp_cron is still active?
- wp_schedule_event – function won’t execute
- WordPress cron creation during plugin installation results with initial execution
- WordPress cron hooks – same callback for completely different action?
- Manually running cron from the server
- How to solve cron problem in WordPress?
- Cron jobs when running multiple instances on the same DB
- WordPress Cron job, 302 response
- How to periodically roll back WordPress to a fixed point in time?
- Send Weekly Email if Users have not complete their profiles
- my wp schedule event is not working
- WP-Cron function not firing
- WP Cron scheduling doesn’t work reliably on hosted server
- Time limit on long cron job?
- Call to undefined function wp_create_category()
- WP-Cron called by separate server
- WP_cron keeps going back to the past
- Cron and request with wp_remote_post
- Real cron killed my cron system. Only define( ‘ALTERNATE_WP_CRON’, true ); works
- Unknown requests on my WP Site
- wp_schedule_event doesn’t work
- WordPress CRON job working when reloading the page
- What am I doing wrong creating post draft via wp-cron? (wp_schedule_event & wp_insert_post)
- Run function at a specific time of a day
- WP cron and update post meta
- WP-Cron system doesn’t work on server
- Cron Job Scheduling in wordpress
- Schedule reminder at exact time
- Schedule Removal of Menu Page and Shortcode
- Sending emails to separate accounts using a for loop
- daily job to run send email based on user data
- Huge cron option_value into wp_options table
- setting up a wp cron job
- Cron Lock Timeout, when to use?
- Regenerating array key for wp_schedule_event args
- WP cron Executes once and doesnt repeat
- wp-cron not working
- how to crate cronjo not depending on user access
- Cron event running more than once if triggered from WP Crontrol
- wp_privacy_delete_old_export_files, failed to run
- How to Auto Update WordPress Post after specific time?
- Change a Post’s Status based on the date from a custom field? (for Event posts)
- Multiple conditional logic in Custom Event In WP_ Cron not working
- wp_schedule_event with dynamic names but same function
- Definition of page load for WP-Cron?
- Protect wp-cron from hackers