Plugin Updates

This commit is contained in:
Tony Volpe
2024-03-19 15:33:31 +00:00
parent ff5b56dc44
commit 3a70a6e4bf
317 changed files with 8178 additions and 2933 deletions

View File

@@ -10,6 +10,19 @@ class ActionScheduler_Action {
protected $schedule = NULL;
protected $group = '';
/**
* Priorities are conceptually similar to those used for regular WordPress actions.
* Like those, a lower priority takes precedence over a higher priority and the default
* is 10.
*
* Unlike regular WordPress actions, the priority of a scheduled action is strictly an
* integer and should be kept within the bounds 0-255 (anything outside the bounds will
* be brought back into the acceptable range).
*
* @var int
*/
protected $priority = 10;
public function __construct( $hook, array $args = array(), ActionScheduler_Schedule $schedule = NULL, $group = '' ) {
$schedule = empty( $schedule ) ? new ActionScheduler_NullSchedule() : $schedule;
$this->set_hook($hook);
@@ -93,4 +106,30 @@ class ActionScheduler_Action {
public function is_finished() {
return FALSE;
}
/**
* Sets the priority of the action.
*
* @param int $priority Priority level (lower is higher priority). Should be in the range 0-255.
*
* @return void
*/
public function set_priority( $priority ) {
if ( $priority < 0 ) {
$priority = 0;
} elseif ( $priority > 255 ) {
$priority = 255;
}
$this->priority = (int) $priority;
}
/**
* Gets the action priority.
*
* @return int
*/
public function get_priority() {
return $this->priority;
}
}