/** * 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(); }
/** * 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 = array()) { // set the proper query args $this->set_args($args); // include child categories in the query, save categories for reuse $this->set_queried_event_cats(); // decide if we should use the month view cache $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__Template_Part_Cache('month/content.php', serialize($this->args), $cache_expiration, 'save_post'); } $this->events_per_day = apply_filters('tribe_events_month_day_limit', tribe_get_option('monthEventAmount', '3')); $this->requested_date = $this->requested_date(); $this->first_grid_date = self::calculate_first_cell_date($this->requested_date); $this->final_grid_date = self::calculate_final_cell_date($this->requested_date); // get all the ids for the events in this month, speeds up queries $this->set_events_in_month(); // 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(); }
/** * The class constructor. */ public function __construct() { parent::__construct(); add_action('tribe_events_asset_package', array(__CLASS__, 'asset_package'), 10, 2); }
/** * 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 = array()) { // set the proper query args $this->set_args($args); // include child categories in the query, save categories for reuse $this->set_queried_event_cats(); /** * Controls whether or not month view caching is enabled. * * Filtering this value can be useful if you need to implement * a fine grained caching policy for month view. * * @param boolean $enable * @param array $args */ $this->use_cache = apply_filters('tribe_events_enable_month_view_cache', $this->should_enable_month_view_cache(), $this->args); // 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__Template_Part_Cache('month/content.php', serialize($this->args), $cache_expiration, 'save_post'); } $this->events_per_day = apply_filters('tribe_events_month_day_limit', tribe_get_option('monthEventAmount', '3')); $this->requested_date = $this->requested_date(); $this->first_grid_date = self::calculate_first_cell_date($this->requested_date); $this->final_grid_date = self::calculate_final_cell_date($this->requested_date); // get all the ids for the events in this month, speeds up queries $this->set_events_in_month(); // 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(); }
/** * 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'); } $args = (array) $args; self::$args = (array) $args; $this->events_per_day = apply_filters('tribe_events_month_day_limit', tribe_get_option('monthEventAmount', '3')); $this->requested_date = $this->requested_date(); $this->first_grid_date = $this->calculate_first_cell_date($this->requested_date); $this->final_grid_date = $this->calculate_final_cell_date($this->requested_date); // get all the ids for the events in this month, speeds up queries $this->events_in_month = tribe_get_events(array_merge($args, array('fields' => 'ids', 'start_date' => $this->first_grid_date, 'end_date' => $this->final_grid_date, 'posts_per_page' => -1))); // 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(); }
/** * Constructor * * @author Modern Tribe **/ public function __construct() { parent::__construct(); wp_enqueue_style('tribe-agenda-view', get_stylesheet_directory_uri() . "/tribe-events/agenda-view.css", array(), '0.1', 'screen'); wp_enqueue_script('tribe-agenda-view-scripts', get_stylesheet_directory_uri() . "/tribe-events/agenda-view.js", array('jquery'), null, true); }