[ Index ] |
MailPress 7.2 |
[ Index ] [ Classes ] [ Functions ] [ Variables ] [ Constants ] [ Statistics ] |
[Summary view] [Print] [Text view]
1 <?php 2 abstract class MP_newsletter_scheduler_ extends MP_newsletter_ 3 { 4 public $args = 'scheduler'; 5 public static $delta = 1; 6 7 function __construct( $description ) 8 { 9 parent::__construct( $description ); 10 11 add_filter( "MailPress_newsletter_scheduler_{$this->id}_schedule", array( $this, 'schedule' ), 8, 1 ); 12 } 13 14 function schedule( $newsletter ) { $this->newsletter = $newsletter; return false; } 15 16 function schedule_single_event( $timestamp, $event = 'mp_process_newsletter' ) 17 { 18 if ( is_string( $timestamp ) ) 19 { 20 $date = DateTime::createFromFormat( 'Y-m-d H:i:s', $timestamp, wp_timezone() ); 21 $timestamp = $date->getTimestamp(); 22 } 23 24 $timestamp += self::$delta; 25 self::$delta += 1; 26 27 wp_schedule_single_event( $timestamp, $event, array( 'args' => array( 'newsletter' => $this->newsletter ) ) ); 28 29 return MP_Newsletter_schedulers::schedule_report( $this->newsletter, $timestamp, $this->id ); 30 } 31 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue May 19 15:55:14 2020 | Cross-referenced by PHPXref 0.7.1 |