Skip to content

Commit

Permalink
Fix service type not being assigned
Browse files Browse the repository at this point in the history
Closes #115
  • Loading branch information
Nikola committed Oct 16, 2017
1 parent 75e946c commit 99c2856
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
21 changes: 20 additions & 1 deletion includes/sm-deprecated-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,23 @@
*/
function wpfc_sermon_date( $d, $before = '', $after = '' ) {
sm_the_date( $d, $before = '', $after = '' );
}
}

/**
* Saves service type
*
* Will be obsolete when we add new meta boxes code
*
* @param int $post_ID
*/
function set_service_type( $post_ID ) {
if ( isset( $_POST['wpfc_service_type'] ) ) {
if ( $term = get_term_by( 'id', $_POST['wpfc_service_type'], 'wpfc_service_type' ) ) {
$service_type = $term->slug;
}

wp_set_object_terms( $post_ID, empty( $service_type ) ? null : $service_type, 'wpfc_service_type' );
}
}

add_action( 'save_post', 'set_service_type', 99 );
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.5
Stable tag: 2.8.6
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.6 ###
* Fix Service Type not being assigned (fixes sermons not appearing under some configurations)

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

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.5
* Version: 2.8.6
* Author: WP for Church
* Author URI: https://www.wpforchurch.com/
* Requires at least: 4.5
Expand Down

0 comments on commit 99c2856

Please sign in to comment.