Esempio n. 1
0
 /**
  * Set the notices used on month view
  *
  * @param array $args Set of $wp_query params for the month view, if none passed then will default to $wp_query
  */
 public function __construct($args = null)
 {
     if ($args === null) {
         global $wp_query;
         $args = $wp_query->query;
         if (!empty($wp_query->query_vars['meta_query'])) {
             $args['meta_query'] = $wp_query->query_vars['meta_query'];
         }
     }
     $this->use_cache = tribe_get_option('enable_month_view_cache', false);
     // Cache the result of month/content.php
     if ($this->use_cache) {
         $cache_expiration = apply_filters('tribe_events_month_view_transient_expiration', HOUR_IN_SECONDS);
         $this->html_cache = new Tribe__Events__Template_Part_Cache('month/content.php', serialize($args), $cache_expiration, 'save_post');
     }
     self::$args = $args;
     self::$posts_per_page_limit = apply_filters('tribe_events_month_day_limit', tribe_get_option('monthEventAmount', '3'));
     // don't enqueue scripts and js when we're not constructing month view,
     // they'll have to be enqueued separately
     if (!tribe_is_month()) {
         $this->asset_packages = array();
     }
     parent::__construct();
 }