Skip to content

Instantly share code, notes, and snippets.

@michaeluno
Created May 12, 2015 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaeluno/5819636448947e7ab733 to your computer and use it in GitHub Desktop.
Save michaeluno/5819636448947e7ab733 to your computer and use it in GitHub Desktop.
A custom action plugin of the Task Scheduler WordPress plugin.
<?php
/**
* Plugin Name: Task Scheduler - Sample Action
* Plugin URI: http://en.michaeluno.jp/
* Description: Uses a custom action with Task Scheduler.
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* 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 );
@Jean-JacquesD
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