Skip to content

Instantly share code, notes, and snippets.

@EdwardBock
Last active October 18, 2021 05:20
Show Gist options
  • Save EdwardBock/08d00ca76e2c21a8a6a0e885f1245925 to your computer and use it in GitHub Desktop.
Save EdwardBock/08d00ca76e2c21a8a6a0e885f1245925 to your computer and use it in GitHub Desktop.
<?php
namespace PublicFunctionOrg\WordPress\Schedule;
const SCHEDULE_ACTION = "public_function_org_schedule";
function init(){
if(!wp_next_scheduled(SCHEDULE_ACTION)){
wp_schedule_event(time(), 'hourly', SCHEDULE_ACTION);
}
}
add_action('admin_init', __NAMESPACE__.'\init');
function run(){
// scheduled for execution once an hour
}
add_action(SCHEDULE_ACTION, __NAMESPACE__.'\run');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment