Last active
October 18, 2021 05:20
-
-
Save EdwardBock/08d00ca76e2c21a8a6a0e885f1245925 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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