Skip to content

Commit

Permalink
Release 2.15.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola Miljković committed Dec 13, 2018
2 parents 8173124 + eedccea commit 10ad463
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 9 deletions.
1 change: 1 addition & 0 deletions assets/css/partials/_shortcodes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ $overcast-color : #ff8800;

.subscribe {
text-align: center;
margin: 0;

li {
display: inline-block;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/sermon.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/sermon.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions includes/class-sm-dates-wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,39 @@ public static function save_terms_dates( $post_ID, $post, $update ) {
$original_terms = $GLOBALS['sm_original_terms'];
$updated_terms = isset( $_POST['tax_input'] ) ? $_POST['tax_input'] : null;

// Convert terms to term array of term IDs if it's not already that way.
foreach ( $updated_terms as $taxonomy => $terms ) {
if ( is_string( $terms ) ) {
if ( '' === $terms ) {
$updated_terms[ $taxonomy ] = array();
continue;
}

if ( strpos( $terms, ',' ) !== false ) {
$terms = explode( ',', $terms );
$terms = array_filter( $terms, 'trim' );
}

if ( ! is_array( $terms ) ) {
$terms = array( $terms );
}

$updated_terms[ $taxonomy ] = array();

foreach ( $terms as $term ) {
if ( is_int( $term ) ) {
continue 1;
}

$term = get_term_by( 'slug', $term, $taxonomy );

if ( ! $term instanceof WP_Error && $term && isset( $term->term_id ) ) {
$updated_terms[ $taxonomy ][] = $term->term_id;
}
}
}
}

$updated_terms += array_fill_keys( sm_get_taxonomies(), array() );

if ( ! $updated_terms ) {
Expand Down
21 changes: 16 additions & 5 deletions includes/sm-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function render_wpfc_sorting( $args = array() ) {
$action = '';

// Filters HTML fields data.
$filters = array(
$filters = apply_filters( 'render_wpfc_sorting_filters', array(
array(
'className' => 'sortPreacher',
'taxonomy' => 'wpfc_preacher',
Expand All @@ -86,15 +86,15 @@ function render_wpfc_sorting( $args = array() ) {
'taxonomy' => 'wpfc_service_type',
'title' => __( 'Service Type', 'sermon-manager-for-wordpress' ),
),
);
) );

$visibility_mapping = array(
$visibility_mapping = apply_filters( 'render_wpfc_sorting_visibility_mapping', array(
'wpfc_sermon_topics' => 'hide_topics',
'wpfc_sermon_series' => 'hide_series',
'wpfc_preacher' => 'hide_preachers',
'wpfc_bible_book' => 'hide_books',
'wpfc_service_type' => 'hide_service_types',
);
) );

// Save orig args for filters.
$orig_args = $args;
Expand Down Expand Up @@ -607,7 +607,18 @@ function wpfc_get_term_dropdown( $taxonomy, $default = '' ) {
$html .= '<option value="' . $term->slug . '" ' . ( ( '' === $default ? $current_slug === $term->slug : $default === $term->slug ) ? 'selected' : '' ) . '>' . $term->name . '</option>';
}

return $html;
/**
* Allows you to filter the dropdown options (HTML).
*
* @var string $html The existing HTML.
* @var array $taxonomy The taxonomy that is being used.
* @var string $default The forced default value. See function PHPDoc.
* @var array $terms The array of terms, books will already be ordered.
* @var string $current_slug The term that is being requested.
*
* @since 2.15.12
*/
return apply_filters( 'wpfc_get_term_dropdown', $html, $taxonomy, $default, $terms, $current_slug );
}

/**
Expand Down
6 changes: 5 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: 5.0
Requires PHP: 5.3
Stable tag: 2.15.11
Stable tag: 2.15.12
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

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

## Changelog ##
### 2.15.12 ###
* Fix: Fatal error when saving a sermon
* Fix: Podcast buttons shortcode has unnecessary left margin (thanks @macbookandrew!)

### 2.15.11 ###
* New: Add support for "The7" theme
* Change: Add "sermon" order to [sermon_images] shortcode. It will order the series by newest sermon
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.15.11
* Version: 2.15.12
* Author: WP for Church
* Author URI: https://www.wpforchurch.com/
* Requires at least: 4.5
Expand Down

0 comments on commit 10ad463

Please sign in to comment.