[ Index ]

MailPress 7.2

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

title

Body

[close]

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

   1  <?php
   2  class MP_Newsletter_scheduler_week extends MP_newsletter_scheduler_
   3  {
   4      public $id = 'week';
   5  
   6  	function schedule( $newsletter ) 
   7      {
   8          $this->newsletter = $newsletter;
   9  
  10          $time = $this->time;
  11  
  12          $format = 'Y-m-d ' . zeroise( $this->get_hour(), 2 ) . ':' . zeroise( $this->get_minute(), 2 ) . ':00';
  13  
  14          $first_wday = $this->get_wday();
  15  
  16          while ( wp_date( 'w', $time ) != $first_wday ) $time += DAY_IN_SECONDS;
  17  
  18          $timestamp = wp_date( $format, $time );
  19  
  20          if ( $timestamp < $this->date )
  21          {
  22              $time += WEEK_IN_SECONDS;
  23              $timestamp = wp_date( $format, $time );
  24          }
  25  
  26          return $this->schedule_single_event( $timestamp );
  27      }
  28  }
  29  new MP_Newsletter_scheduler_week( __( 'Every week', 'MailPress' ) );


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