updated plugin WP Mail SMTP
version 2.1.1
This commit is contained in:
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class ActionScheduler_Action
|
||||
*/
|
||||
class ActionScheduler_Action {
|
||||
protected $hook = '';
|
||||
protected $args = array();
|
||||
/** @var ActionScheduler_Schedule */
|
||||
protected $schedule = NULL;
|
||||
protected $group = '';
|
||||
|
||||
public function __construct( $hook, array $args = array(), ActionScheduler_Schedule $schedule = NULL, $group = '' ) {
|
||||
$schedule = empty( $schedule ) ? new ActionScheduler_NullSchedule() : $schedule;
|
||||
$this->set_hook($hook);
|
||||
$this->set_schedule($schedule);
|
||||
$this->set_args($args);
|
||||
$this->set_group($group);
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
return do_action_ref_array($this->get_hook(), $this->get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $hook
|
||||
*/
|
||||
protected function set_hook( $hook ) {
|
||||
$this->hook = $hook;
|
||||
}
|
||||
|
||||
public function get_hook() {
|
||||
return $this->hook;
|
||||
}
|
||||
|
||||
protected function set_schedule( ActionScheduler_Schedule $schedule ) {
|
||||
$this->schedule = $schedule;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ActionScheduler_Schedule
|
||||
*/
|
||||
public function get_schedule() {
|
||||
return $this->schedule;
|
||||
}
|
||||
|
||||
protected function set_args( array $args ) {
|
||||
$this->args = $args;
|
||||
}
|
||||
|
||||
public function get_args() {
|
||||
return $this->args;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $group
|
||||
*/
|
||||
protected function set_group( $group ) {
|
||||
$this->group = $group;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_group() {
|
||||
return $this->group;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool If the action has been finished
|
||||
*/
|
||||
public function is_finished() {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class ActionScheduler_CanceledAction
|
||||
*
|
||||
* Stored action which was canceled and therefore acts like a finished action but should always return a null schedule,
|
||||
* regardless of schedule passed to its constructor.
|
||||
*/
|
||||
class ActionScheduler_CanceledAction extends ActionScheduler_FinishedAction {
|
||||
|
||||
/**
|
||||
* @param string $hook
|
||||
* @param array $args
|
||||
* @param ActionScheduler_Schedule $schedule
|
||||
* @param string $group
|
||||
*/
|
||||
public function __construct( $hook, array $args = array(), ActionScheduler_Schedule $schedule = null, $group = '' ) {
|
||||
parent::__construct( $hook, $args, $schedule, $group );
|
||||
if ( is_null( $schedule ) ) {
|
||||
$this->set_schedule( new ActionScheduler_NullSchedule() );
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class ActionScheduler_FinishedAction
|
||||
*/
|
||||
class ActionScheduler_FinishedAction extends ActionScheduler_Action {
|
||||
|
||||
public function execute() {
|
||||
// don't execute
|
||||
}
|
||||
|
||||
public function is_finished() {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class ActionScheduler_NullAction
|
||||
*/
|
||||
class ActionScheduler_NullAction extends ActionScheduler_Action {
|
||||
|
||||
public function __construct( $hook = '', array $args = array(), ActionScheduler_Schedule $schedule = NULL ) {
|
||||
$this->set_schedule( new ActionScheduler_NullSchedule() );
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
// don't execute
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user