1:55 PM
2:39 PM
3:12 PM
3:46 PM
4:18 PM
I'd use a different name than
wp_api
, it wouldn't surprise me if that was already a hook used by the rest API
4:32 PM
eitherway if things aren't working properly with a core API, it's always a good idea to go back to the devhub and the codex and look at the examples and piece together how they work and then try to implement your own thing as simply as possible, then once it works, build back up from there
function tomjn_cron_job( $job_name, $when, $schedule, Callback $callback ) { add_action( $job_name, $callback ); if ( ! wp_next_scheduled( $job_name ) ) { wp_schedule_event( strtotime( $when ), $schedule, $job_name ); } } add_action( 'init', function() { tomjn_cron_job( 'tomjn_add_numbers', '16:00:00', 'daily', function() { $val = 1 + 1; }); }
« first day (2949 days earlier) ← previous day next day → last day (1963 days later) »