Skip to content

Commit

Permalink
Merge pull request #50 from WP-for-Church/dev
Browse files Browse the repository at this point in the history
Release 2.4.6
  • Loading branch information
Nikola Miljković authored Aug 9, 2017
2 parents cc84aa0 + 9f9c601 commit 8f103a9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 17 deletions.
43 changes: 31 additions & 12 deletions includes/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,11 @@ function wpfc_sermon_options_render_form() {
<tr valign="top">
<th scope="row"><?php _e( 'Show key verse in widget', 'sermon-manager' ); ?></th>
<td>
<label><input name="wpfc_options[widget_show_key_verse]" type="checkbox"
<label><input name="wpfc_options[widget_show_key_verse]"
type="checkbox"
value="1" <?php if ( isset( $options['widget_show_key_verse'] ) ) {
checked( '1', $options['widget_show_key_verse'] );
} ?> /> <?php _e( 'Show key verse in widget', 'sermon-manager' ); ?>
checked( '1', $options['widget_show_key_verse'] );
} ?> /> <?php _e( 'Show key verse in widget', 'sermon-manager' ); ?>
</label><br/>
</td>
</tr>
Expand Down Expand Up @@ -677,14 +678,31 @@ function wpfc_sermon_options_render_form() {
<tr>
<th scope="row">Enable HTML desciption</th>
<td>
<label><input name="wpfc_options[enable_podcast_html_description]" type="checkbox"
<label><input name="wpfc_options[enable_podcast_html_description]"
type="checkbox"
value="1" <?php if ( isset( $options['enable_podcast_html_description'] ) ) {
checked( '1', $options['enable_podcast_html_description'] );
} ?> />Enable HTML desciption
checked( '1', $options['enable_podcast_html_description'] );
} ?> />Enable HTML desciption
</label><br/>
</td>
<td class="info">
<p>Enables showing of HTML in iTunes description field. Uncheck if description looks messy.</p>
<p>Enables showing of HTML in iTunes description field. Uncheck if
description looks messy.</p>
</td>
</tr>

<tr>
<th scope="row">Number of podcasts to show</th>
<td>
<label>
<input name="wpfc_options[podcasts_per_page]" type="number"
value="<?php echo isset( $options['podcasts_per_page'] ) ? intval( $options['podcasts_per_page'] ) : ''; ?>"
placeholder="<?php echo get_option( 'posts_per_rss' ); ?>">
</label><br/>
</td>
<td class="info">
<p>Shows custom podcast count. If not defined, it uses WordPress
defaut count.</p>
</td>
</tr>

Expand Down Expand Up @@ -744,8 +762,8 @@ function wpfc_sermon_options_render_form() {
/**
* Shows zsh-like CLI, 'sermon-manager@website.com'
*
* @param string $command Command to execute
* @param bool $close_span False to not close <span>
* @param string $command Command to execute
* @param bool $close_span False to not close <span>
*/
function wpfc_console_zsh( $command = '', $close_span = true ) {
?>
Expand Down Expand Up @@ -798,16 +816,17 @@ function wpfc_console_zsh( $command = '', $close_span = true ) {
}

// Sanitize and validate input. Accepts an array, return a sanitized array.
function wpfc_validate_options( $input ) {
static function wpfc_validate_options( $input ) {
add_option( 'sermon_image_plugin_settings', array(
'taxonomies' => array( 'wpfc_sermon_series', 'wpfc_preacher', 'wpfc_sermon_topics' )
) );
// Flush rewrite rules on save
global $wp_rewrite;
$wp_rewrite->flush_rules();

$input['archive_slug'] = wp_filter_nohtml_kses( $input['archive_slug'] ); // Sanitize textbox input (strip html tags, and escape characters)
$input['archive_title'] = wp_filter_nohtml_kses( $input['archive_title'] ); // Sanitize textbox input (strip html tags, and escape characters)
$input['archive_slug'] = wp_filter_nohtml_kses( $input['archive_slug'] ); // Sanitize textbox input (strip html tags, and escape characters)
$input['archive_title'] = wp_filter_nohtml_kses( $input['archive_title'] ); // Sanitize textbox input (strip html tags, and escape characters)
$input['podcasts_per_page'] = intval( $input['podcasts_per_page'] );

return $input;
}
Expand Down
4 changes: 4 additions & 0 deletions includes/podcast-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ function wpfc_podcast_add_hooks( $query ) {
)
)
);

if ( intval( \SermonManager::getOption( 'podcasts_per_page' ) ) !== 0 ) {
$query->set( 'posts_per_rss', intval( \SermonManager::getOption( 'podcasts_per_page' ) ) );
}
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: wpforchurch
Donate link: http://wpforchurch.com/
Tags: church, sermon, sermons, preaching, podcasting
Requires at least: 4.5
Tested up to: 4.8.0
Stable tag: 2.4.5
Tested up to: 4.8.1
Stable tag: 2.4.6

Add audio and video sermons, manage speakers, series, and more to your church website.

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

== Changelog ==
= 2.4.6 =
* Add a setting to define podcast count
* Fix a bug that caused WSOD on some hosts
* Fix a bug that prevented settings to save on some hosts

= 2.4.5 =
* Fix error that rendered website unusable on some hosts
* Fix double line-breaks in the podcast description not changing into HTML paragraphs
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: http://www.wpforchurch.com/products/sermon-manager-for-wordpress/
Description: Add audio and video sermons, manage speakers, series, and more. Visit <a href="http://wpforchurch.com" target="_blank">Wordpress for Church</a> for tutorials and support.
Version: 2.4.5
Version: 2.4.6
Author: WP for Church
Contributors: wpforchurch, jprummer, jamzth
Author URI: http://www.wpforchurch.com/
Expand Down Expand Up @@ -36,8 +36,7 @@ public function __construct() {
}

// Define constants (PATH and URL are with a trailing slash)
// Works with symlinks too!
define( 'SERMON_MANAGER_PATH', rtrim( WP_PLUGIN_DIR, '/\\' ) . '/' . basename( __DIR__ ) );
define( 'SERMON_MANAGER_PATH', plugin_dir_path( __FILE__ ) );
define( 'SERMON_MANAGER_URL', plugin_dir_url( __FILE__ ) );
define( 'SERMON_MANAGER_VERSION', preg_match( '/^.*Version: (.*)$/m', file_get_contents( __FILE__ ), $version ) ? trim( $version[1] ) : 'N/A' );

Expand Down

0 comments on commit 8f103a9

Please sign in to comment.