Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A custom action plugin of the Task Scheduler WordPress plugin.
* Plugin Name: Task Scheduler - Sample Action
* Plugin URI:
* Description: Uses a custom action with Task Scheduler.
* Author: Michael Uno
* Author URI:
* Version: 1.0.0
* Called when the Task Scheduler plugin gets loaded.
function doMyCustomAction( $sExitCode, $oRoutine ) {
* Do you stuff here.
TaskScheduler_Debug::log( $oRoutine->getMeta() );
return 1;
* Set the`my_custom_action` custom action slug in the Select Action screen
* via Dashboard -> Task SCheduler -> Add New Task.
add_filter( 'my_custom_action', 'doMyCustomAction', 10, 2 );
Copy link

I would like a working example please. I would like to have a task.php scheduled at 24:00 every day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment