Skip to content

Commit

Permalink
Release 2.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola Miljković committed Oct 4, 2018
2 parents d7c6401 + 6229176 commit 565ed90
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 37 deletions.
51 changes: 28 additions & 23 deletions includes/admin/sm-cmb-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@
* Define the metaboxes and field configurations.
*/
function wpfc_sermon_metaboxes() {

$cmb = new_cmb2_box( array(
'id' => 'wpfc_sermon_details',
'title' => esc_html__( 'Sermon Details', 'sermon-manager-for-wordpress' ),
'object_types' => array( 'wpfc_sermon' ), // Post type.
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left.
) );

// Get the date format.
switch ( \SermonManager::getOption( 'date_format' ) ) {
case '0':
$date_format_label = 'mm/dd/YYYY';
Expand All @@ -44,16 +35,23 @@ function wpfc_sermon_metaboxes() {
break;
}

$cmb->add_field( array(
$sermon_details_meta = new_cmb2_box( array(
'id' => 'wpfc_sermon_details',
'title' => esc_html__( 'Sermon Details', 'sermon-manager-for-wordpress' ),
'object_types' => array( 'wpfc_sermon' ), // Post type.
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left.
) );
$sermon_details_meta->add_field( array(
'name' => esc_html__( 'Date Preached', 'sermon-manager-for-wordpress' ),
// translators: %s date format, effectively <code>d/m/Y</code> or the like.
'desc' => esc_html__( '(optional)', 'sermon-manager-for-wordpress' ) . '<br>' . wp_sprintf( esc_html__( 'format: %s', 'sermon-manager-for-wordpress' ), $date_format_label ),
'id' => 'sermon_date',
'type' => 'text_date_timestamp',
'date_format' => $date_format,
) );

$cmb->add_field( array(
$sermon_details_meta->add_field( array(
'name' => esc_html__( 'Service Type', 'sermon-manager-for-wordpress' ),
// translators: %s <a href="edit-tags.php?taxonomy=wpfc_service_type&post_type=wpfc_sermon" target="_blank">here</a>.
'desc' => wp_sprintf( esc_html__( 'Select the type of service. Modify service types %s.', 'sermon-manager-for-wordpress' ), '<a href="' . admin_url( 'edit-tags.php?taxonomy=wpfc_service_type&post_type=wpfc_sermon' ) . '" target="_blank">here</a>' ),
Expand All @@ -62,16 +60,15 @@ function wpfc_sermon_metaboxes() {
'show_option_none' => true,
'options' => cmb2_get_term_options( 'wpfc_service_type' ),
) );

$cmb->add_field( array(
$sermon_details_meta->add_field( array(
'name' => esc_html__( 'Main Bible Passage', 'sermon-manager-for-wordpress' ),
// translators: %1$s see msgid "John 3:16-18", effectively <code>John 3:16-18</code><br>.
// translators: %2$s see msgid "John 3:16-18, John 2:11-12", effectively <code>John 3:16-18, Luke 2:1-3</code>.
'desc' => wp_sprintf( esc_html__( 'Enter the Bible passage with the full book names, e.g. %1$s Or multiple books like %2$s', 'sermon-manager-for-wordpress' ), '<code>' . esc_html__( 'John 3:16-18', 'sermon-manager-for-wordpress' ) . '</code><br>', '<code>' . esc_html__( 'John 3:16-18, Luke 2:1-3', 'sermon-manager-for-wordpress' ) . '</code>' ),
'id' => 'bible_passage',
'type' => 'text',
) );
$cmb->add_field( array(
$sermon_details_meta->add_field( array(
'name' => esc_html__( 'Description', 'sermon-manager-for-wordpress' ),
'desc' => esc_html__( 'Type a brief description about this sermon, an outline, or a full manuscript', 'sermon-manager-for-wordpress' ),
'id' => 'sermon_description',
Expand All @@ -82,15 +79,15 @@ function wpfc_sermon_metaboxes() {
),
) );

$cmb2 = new_cmb2_box( array(
$sermon_files_meta = new_cmb2_box( array(
'id' => 'wpfc_sermon_files',
'title' => esc_html__( 'Sermon Files', 'sermon-manager-for-wordpress' ),
'object_types' => array( 'wpfc_sermon' ),
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
) );
$cmb2->add_field( array(
$sermon_files_meta->add_field( array(
'name' => esc_html__( 'Location of MP3', 'sermon-manager-for-wordpress' ),
'desc' => esc_html__( 'Upload an audio file or enter an URL.', 'sermon-manager-for-wordpress' ),
'id' => 'sermon_audio',
Expand All @@ -99,26 +96,26 @@ function wpfc_sermon_metaboxes() {
'add_upload_file_text' => 'Add Sermon Audio', // Change upload button text. Default: "Add or Upload File".
),
) );
$cmb2->add_field( array(
$sermon_files_meta->add_field( array(
'name' => esc_html__( 'MP3 Duration', 'sermon-manager-for-wordpress' ),
// translators: %s see msgid "hh:mm:ss", effectively <code>hh:mm:ss</code>.
'desc' => wp_sprintf( esc_html__( 'Length in %s format (fill out only for remote files, local files will get data calculated by default)', 'sermon-manager-for-wordpress' ), '<code>' . esc_html__( 'hh:mm:ss', 'sermon-manager-for-wordpress' ) . '</code>' ),
'id' => '_wpfc_sermon_duration',
'type' => 'text',
) );
$cmb2->add_field( array(
$sermon_files_meta->add_field( array(
'name' => esc_html__( 'Video Embed Code', 'sermon-manager-for-wordpress' ),
'desc' => esc_html__( 'Paste your embed code for Vimeo, Youtube, Facebook, or direct video file here', 'sermon-manager-for-wordpress' ),
'id' => 'sermon_video',
'type' => 'textarea_code',
) );
$cmb2->add_field( apply_filters( 'sm_cmb2_field_sermon_video_link', array(
$sermon_files_meta->add_field( apply_filters( 'sm_cmb2_field_sermon_video_link', array(
'name' => esc_html__( 'Video Link', 'sermon-manager-for-wordpress' ),
'desc' => esc_html__( 'Paste your link for Vimeo, Youtube, Facebook, or direct video file here', 'sermon-manager-for-wordpress' ),
'id' => 'sermon_video_link',
'type' => 'text_url',
) ) );
$cmb2->add_field( array(
$sermon_files_meta->add_field( array(
'name' => esc_html__( 'Sermon Notes', 'sermon-manager-for-wordpress' ),
'desc' => esc_html__( 'Upload a pdf file or enter an URL.', 'sermon-manager-for-wordpress' ),
'id' => 'sermon_notes',
Expand All @@ -128,7 +125,7 @@ function wpfc_sermon_metaboxes() {
// Change upload button text. Default: "Add or Upload File".
),
) );
$cmb2->add_field( array(
$sermon_files_meta->add_field( array(
'name' => esc_html__( 'Bulletin', 'sermon-manager-for-wordpress' ),
'desc' => esc_html__( 'Upload a pdf file or enter an URL.', 'sermon-manager-for-wordpress' ),
'id' => 'sermon_bulletin',
Expand All @@ -138,6 +135,14 @@ function wpfc_sermon_metaboxes() {
// Change upload button text. Default: "Add or Upload File".
),
) );

/**
* Allows to add/remove SM CMB2 fields.
*
* @param CMB2 $sermon_details_meta Sermon Details meta.
* @param CMB2 $sermon_files_meta Sermon Files meta box.
*/
do_action( 'sm_cmb2_meta_fields', $sermon_details_meta, $sermon_files_meta );
}

add_action( 'cmb2_admin_init', 'wpfc_sermon_metaboxes' );
Expand Down
1 change: 0 additions & 1 deletion includes/sm-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ function wpfc_sermon_single_v2( $return = false, $post = null ) {
*/
function wpfc_sermon_excerpt_v2( $return = false, $args = array() ) {
global $post;
global $wp_the_query;

if ( empty( $args ) ) {
$args = array(
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.7.0
Tested up to: 4.9
Requires PHP: 5.3
Stable tag: 2.15.0
Stable tag: 2.15.1
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

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

## Changelog ##
### 2.15.1 ###
* Fix: Multi-term filter for feeds not working

### 2.15.0 ###
* New: Add ability to override Sermon Manager's CSS by putting "sermon.css" file in theme (thanks @zSeriesGuy)
* New: Add default image during installation (thanks @zSeriesGuy)
Expand Down
5 changes: 2 additions & 3 deletions 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.15.0
* Version: 2.15.1
* Author: WP for Church
* Author URI: https://www.wpforchurch.com/
* Requires at least: 4.5
Expand Down Expand Up @@ -448,8 +448,7 @@ public function render_sermon_into_content( $post_ID = 0, $post = null, $skip_ch
$description = strip_tags( trim( get_post_meta( $post->ID, 'sermon_description', true ) ) );

if ( '' !== $description ) {
$content .= PHP_EOL . PHP_EOL;
$content .= $description;
$content .= ' | ' . $description;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion views/archive-wpfc_sermon.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
echo '</div>';
else :
__( 'Sorry, but there aren\'t any posts matching your query.' );
echo __( 'Sorry, but there aren\'t any posts matching your query.' );
endif;
?>

Expand Down
5 changes: 5 additions & 0 deletions views/partials/content-sermon-wrapper-end.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
get_sidebar();
echo '</div>';
break;
case 'genesis':
echo '</main>';
get_sidebar();
echo '</div>';
break;
default:
ob_start();
get_sidebar();
Expand Down
3 changes: 3 additions & 0 deletions views/partials/content-sermon-wrapper-start.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
case 'x':
echo '<div class="x-container max width offset"><div class="wpfc-sermon-container x-main left ' . $additional_classes . '" role="main">';
break;
case 'genesis':
echo '<div class="content-sidebar-wrap"><main class="content" id="genesis-content">';
break;
default:
echo apply_filters( 'sm_templates_wrapper_start', '<div class="wrap"><div id="primary" class="content-area"><main id="main" class="site-main wpfc-sermon-container ' . $additional_classes . '">' );
break;
Expand Down
2 changes: 1 addition & 1 deletion views/taxonomy-wpfc_bible_book.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
echo '</div>';
else :
__( 'Sorry, but there are no posts matching your query.' );
echo __( 'Sorry, but there are no posts matching your query.' );
endif;
?>

Expand Down
2 changes: 1 addition & 1 deletion views/taxonomy-wpfc_preacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
echo '</div>';
else :
__( 'Sorry, but there are no posts matching your query.' );
echo __( 'Sorry, but there are no posts matching your query.' );
endif;
?>

Expand Down
2 changes: 1 addition & 1 deletion views/taxonomy-wpfc_sermon_series.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
echo '</div>';
else :
__( 'Sorry, but there are no posts matching your query.' );
echo __( 'Sorry, but there are no posts matching your query.' );
endif;
?>

Expand Down
2 changes: 1 addition & 1 deletion views/taxonomy-wpfc_sermon_topics.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
echo '</div>';
else :
__( 'Sorry, but there are no posts matching your query.' );
echo __( 'Sorry, but there are no posts matching your query.' );
endif;
?>

Expand Down
2 changes: 1 addition & 1 deletion views/taxonomy-wpfc_service_type.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
echo '</div>';
else :
__( 'Sorry, but there are no posts matching your query.' );
echo __( 'Sorry, but there are no posts matching your query.' );
endif;
?>

Expand Down
15 changes: 12 additions & 3 deletions views/wpfc-podcast-feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,21 @@
) as $taxonomy
) {
if ( isset( $_GET[ $taxonomy ] ) ) {
$terms = $_GET[ $taxonomy ];
$args['tax_query'] = ! empty( $args['tax_query'] ) ? $args['tax_query'] : array();
$terms = $_GET[ $taxonomy ];

// Override the default tax_query for that taxonomy.
if ( ! empty( $args['tax_query'] ) ) {
foreach ( $args['tax_query'] as $id => $arg ) {
if ( $arg['taxonomy'] === $taxonomy ) {
unset( $args['tax_query'][ $id ] );
}
}
}

$args['tax_query'][] = array(
'taxonomy' => $taxonomy,
'field' => is_numeric( $terms ) ? 'term_id' : 'slug',
'terms' => is_numeric( $terms ) ? intval( $terms ) : false !== strpos( $terms, ',' ) ? array_walk( explode( ',', $terms ), 'sanitize_title' ) : sanitize_title( $terms ),
'terms' => is_numeric( $terms ) ? intval( $terms ) : false !== strpos( $terms, ',' ) ? array_map( 'sanitize_title', explode( ',', $terms ) ) : sanitize_title( $terms ),
);

if ( count( $args['tax_query'] ) > 1 ) {
Expand Down

0 comments on commit 565ed90

Please sign in to comment.