Skip to content

Commit

Permalink
Revert to old render engine, release 2.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola committed Oct 12, 2017
1 parent c1a20b0 commit 75e946c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
21 changes: 16 additions & 5 deletions includes/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
add_action( 'sermon_audio', 'wpfc_sermon_audio', 5 );
add_action( 'sermon_single', 'wpfc_sermon_single' );
add_action( 'sermon_excerpt', 'wpfc_sermon_excerpt' );
add_filter( 'the_content', 'add_wpfc_sermon_content' );

// Include template for displaying sermons
function sermon_template_include( $template ) {
Expand Down Expand Up @@ -438,8 +439,11 @@ function render_wpfc_sermon_excerpt() {
do_action( 'sermon_excerpt' );
}

function wpfc_sermon_excerpt() {
global $post; ?>
function wpfc_sermon_excerpt( $return = false ) {
global $post;

ob_start();
?>
<div class="wpfc_sermon_wrap cf">
<div class="wpfc_sermon_image">
<?php render_sermon_image( apply_filters( 'wpfc_sermon_excerpt_sermon_image_size', 'sermon_small' ) ); ?>
Expand All @@ -464,16 +468,23 @@ function wpfc_sermon_excerpt() {
<?php endif; ?>
</div>
<?php

$output = ob_get_clean();

if ( ! $return ) {
echo $output;
}

return $output;
}

function add_wpfc_sermon_content( $content ) {
if ( 'wpfc_sermon' == get_post_type() && in_the_loop() == true ) {
if ( ! is_feed() && ( is_archive() || is_search() ) ) {
$new_content = render_wpfc_sermon_excerpt();
$content = wpfc_sermon_excerpt( true );
} elseif ( is_singular() && is_main_query() ) {
$new_content = wpfc_sermon_single();
$content = wpfc_sermon_single( true );
}
$content = $new_content;
}

return $content;
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: church, sermon, sermons, preaching, podcasting, manage, managing, podcasts
Requires at least: 4.5
Tested up to: 4.8.2
Requires PHP: 5.3
Stable tag: 2.8.4
Stable tag: 2.8.5
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -93,6 +93,9 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man
2. Sermon Files

## Changelog ##
### 2.8.5 ###
* Revert to old rendering engine, until we fix new one

### 2.8.4 ###
* Fix sermons having to be resaved to work
* Fix fatal error when using plugin views
Expand Down
2 changes: 1 addition & 1 deletion sermons.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Sermon Manager for WordPress
* Plugin URI: https://www.wpforchurch.com/products/sermon-manager-for-wordpress/
* Description: Add audio and video sermons, manage speakers, series, and more.
* Version: 2.8.4
* Version: 2.8.5
* Author: WP for Church
* Author URI: https://www.wpforchurch.com/
* Requires at least: 4.5
Expand Down

0 comments on commit 75e946c

Please sign in to comment.