Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

Jean-JacquesD commented Oct 26, 2017

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
You can’t perform that action at this time.