protected function most_recent_sermon() { switch ($this->att('recent', 'recent')) { case 'audio': return $this->sermons->most_recent_with_audio(); case 'video': return $this->sermons->most_recent_with_video(); } return $this->sermons->most_recent(); }
/** * Hooks into the wp_async_set_sermon_terms action, which is triggered when a post is saved. * * @since 0.1.1 * * @param int $post_id Post ID * @param string $taxonomy Taxonomy */ public function trigger_cache_flush($post_id, $taxonomy) { if ($this->taxonomy() !== $taxonomy || $this->sermons->post_type() !== get_post_type($post_id)) { return; } $this->get_terms_in_sermon_date_order(1); }