[ Index ]

MailPress 7.1

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

title

Body

[close]

/mp-content/add-ons/ -> MailPress_newsletter_categories.php (source)

   1  <?php
   2  if ( class_exists( 'MailPress_newsletter' ) && !class_exists( 'MailPress_newsletter_categories' ) )
   3  {
   4  /*
   5  Plugin Name: MailPress_newsletter_categories
   6  Plugin URI: http://blog.mailpress.org/tutorials/add-ons/newsletter_categories/
   7  Description: Newsletters : for posts per category  ( <span style="color:red;">required !</span> <span style="color:#D54E21;">Newsletter</span> add-on )
   8  Version: 7.1
   9  */
  10  
  11  class MailPress_newsletter_categories extends MP_newsletter_post_type_taxonomy_
  12  {
  13      var $file    = __FILE__;
  14      var $register_priority = 2;
  15  
  16      var $post_type= 'post';
  17      var $taxonomy = 'category';
  18  
  19      var $taxonomy_s = 'categories';
  20      
  21  	function __construct() 
  22      {
  23          parent::__construct();
  24  
  25          unset( $this->args['Template'] );
  26          $this->args['get_terms_args'] = array( 'parent' => 0, 'hide_empty' => 0 );
  27      }
  28  
  29  	function subscriptions_newsletter_th( $th, $newsletter )
  30      {
  31          if ( isset( $newsletter['mail']['the_category'] ) ) return __( 'Post' ) . '/' . $newsletter['mail']['the_category'];
  32          return $th;
  33      }
  34  }
  35  new MailPress_newsletter_categories();
  36  }


Generated: Mon Mar 11 18:33:33 2019 Cross-referenced by PHPXref 0.7.1