[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/options/newsletter/schedulers/ -> month.php (source)

   1  <?php
   2  class MP_Newsletter_scheduler_month extends MP_newsletter_scheduler_
   3  {
   4      public $id = 'month';
   5  
   6  	function schedule( $newsletter ) 
   7      {
   8          $this->newsletter = $newsletter;
   9  
  10          $y = $this->year;
  11          $m = $this->month;
  12          $d = $this->day;
  13  
  14          $h = $this->get_hour();
  15          $i = $this->get_minute();
  16  
  17          $first_day = $this->get_day( $y, $m );
  18  
  19          if ( $d > $first_day )
  20          {
  21              $m++;
  22              if ( $m > 12 ) { $m = 1; $y++; }
  23              $d = $this->get_day( $y, $m );
  24          }
  25  
  26          $timestamp = $this->format_timestamp( $y, $m, $d, $h, $i, 0 );
  27  
  28          if ( $timestamp < $this->date )
  29          {
  30              $m++;
  31              if ( $m > 12 ) { $m = 1; $y++; }
  32              $d = $this->get_day( $y, $m );
  33  
  34              $timestamp = $this->format_timestamp( $y, $m, $d, $h, $i, 0 );
  35          }
  36  
  37          return $this->schedule_single_event( $timestamp );
  38      }
  39  }
  40  new MP_Newsletter_scheduler_month( __( 'Every month', 'MailPress' ) );


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1