Skip to content

Commit

Permalink
Add more filters to output
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola Miljković committed Nov 7, 2018
1 parent 779600c commit 73b0831
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion includes/class-sm-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,9 @@ function display_sermons( $atts = array() ) {

$query = new WP_Query( $query_args );

// Add query to the args.
$args['query'] = $query;

// Set image size. Deprecated.
add_filter( 'wpfc_sermon_excerpt_sermon_image_size', function () use ( $args ) {
return $args['image_size'];
Expand All @@ -943,7 +946,14 @@ function display_sermons( $atts = array() ) {
$query->the_post();
global $post;

echo apply_filters( 'sm_shortcode_sermons_single_output', '<div class="wpfc-sermon wpfc-sermon-shortcode">' . wpfc_sermon_excerpt_v2( true, $args ) . '</div>', $post );
// Allows preventing the call of wpfc_sermon_excerpt_v2().
if ( apply_filters( 'sm_shortcode_output_override', false ) ) {
$output = '';
} else {
$output = '<div class="wpfc-sermon wpfc-sermon-shortcode">' . wpfc_sermon_excerpt_v2( true, $args ) . '</div>';
}

echo apply_filters( 'sm_shortcode_sermons_single_output', $output, $post, $args );
}
?>
</div>
Expand Down

0 comments on commit 73b0831

Please sign in to comment.