+
Sermon Manager Pro
+
+
+
Imagine being able to change the look of your sermons with one click or use your favorite page
+ builder, or create multiple podcasts...well now you can with Sermon Manager Pro, plus a lot
+ more.
+
+
+ Early Adopter pricing ends Nov 23
+
+
+
diff --git a/includes/class-sm-install.php b/includes/class-sm-install.php
index 63c9ab8..2500ebc 100644
--- a/includes/class-sm-install.php
+++ b/includes/class-sm-install.php
@@ -267,6 +267,7 @@ public static function plugin_row_meta( $links, $file ) {
if ( SM_BASENAME == $file ) {
$row_meta = array(
'support' => '
' . esc_html__( 'Premium support', 'sermon-manager-for-wordpress' ) . '',
+ 'smp' => '
' . __( 'Get Sermon Manager Pro', 'sermon-manager-pro' ) . '',
);
return array_merge( $links, $row_meta );
diff --git a/readme.txt b/readme.txt
index d13b87f..d285bef 100755
--- a/readme.txt
+++ b/readme.txt
@@ -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.7
+Stable tag: 2.15.8
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -60,6 +60,25 @@ You can access the paid support options via [our website](http://wpforchurch.com
Bug fixing and fixing unexpected behavior *is free* and *always will be free*. Just [make an issue on GitHub](https://github.com/WP-for-Church/Sermon-Manager/issues/new) or [create a support thread on WordPress](https://wordpress.org/support/plugin/sermon-manager-for-wordpress#new-post) and we will solve it ASAP.
+### Sermon Manager Pro Features ###
+
+* Change your look with Templates
+* Multiple Podcast Support
+* Divi Support & Custom Divi Builder Modules
+* Custom Elementor Elements
+* Custom Beaver Builder Modules
+* Custom WPBakery Page Builder Modules
+* Works with YOUR theme
+* Page Assignment for Archive & Taxonomy
+* Migration from other plugins is a breeze
+* SEO & Marketing Ready
+* Live Chat Support Inside the Plugin
+* PowerPress Compatibility
+* [Full List of Pro Features & Roadmap](https://sermonmanager.pro/)
+
+When you upgrade to Pro you also get premium ticket and live chat support for the free version of Sermon Manager too!
+*Grab your copy of Sermon Manager Pro at early adopter pricing for life between Nov 9th and Nov 23!*
+
### Developers ###
Would you like to help improve Sermon Manager or report a bug you found? This project is open source on [GitHub](https://github.com/WP-for-Church/Sermon-Manager)!
@@ -103,6 +122,10 @@ Visit the [plugin homepage](https://wpforchurch.com/wordpress-plugins/sermon-man
2. Sermon Files
## Changelog ##
+### 2.15.8 ###
+* Dev: Add callable select options (pass function name as string)
+* Dev: Add a way to pass custom values to settings
+
### 2.15.7 ###
* Fix: PHP warning when archive output is used wrongly
* Fix: Podcast items may be sorted the wrong way
diff --git a/sermons.php b/sermons.php
index 00ec4d7..3974205 100755
--- a/sermons.php
+++ b/sermons.php
@@ -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.7
+ * Version: 2.15.8
* Author: WP for Church
* Author URI: https://www.wpforchurch.com/
* Requires at least: 4.5
diff --git a/views/wpfc-podcast-feed.php b/views/wpfc-podcast-feed.php
index c4ec5c7..675c317 100644
--- a/views/wpfc-podcast-feed.php
+++ b/views/wpfc-podcast-feed.php
@@ -9,12 +9,72 @@
global $taxonomy, $term;
+if ( isset( $GLOBALS['sm_podcast_data'] ) && is_array( $GLOBALS['sm_podcast_data'] ) ) {
+ $settings = $GLOBALS['sm_podcast_data'];
+} else {
+ $settings = array();
+}
+
+// Option ID => escape function.
+$default_settings = array(
+ 'podcasts_per_page' => 'intval',
+ 'title' => 'esc_html',
+ 'website_link' => 'esc_url',
+ 'description' => 'esc_html',
+ 'language' => 'esc_html',
+ 'copyright' => 'esc_html',
+ 'itunes_subtitle' => 'esc_html',
+ 'itunes_author' => 'esc_html',
+ 'enable_podcast_html_description' => '',
+ 'itunes_summary' => '',
+ 'itunes_owner_name' => 'esc_html',
+ 'itunes_owner_email' => 'esc_html',
+ 'itunes_cover_image' => 'esc_url',
+ 'itunes_sub_category' => '',
+ 'podcast_sermon_image_series' => '',
+ 'podtrac' => '',
+ 'use_published_date' => '',
+);
+
+// If there is no default.
+$wordpress_settings = array(
+ 'podcasts_per_page' => 10,
+ 'title' => get_wp_title_rss(),
+ 'website_link' => get_bloginfo_rss( 'url' ),
+ 'description' => get_bloginfo_rss( 'description' ),
+ 'language' => get_bloginfo_rss( 'language' ),
+);
+
+foreach ( $default_settings as $id => $escape_function ) {
+ // Get SM podcast setting if there is no custom.
+ if ( ! isset( $settings[ $id ] ) ) {
+ $settings[ $id ] = SermonManager::getOption( $id );
+ }
+
+ // Escape the data.
+ if ( $escape_function ) {
+ $settings[ $id ] = call_user_func( $escape_function, $settings[ $id ] );
+ }
+
+ // Get the WordPress or custom default if there is no custom setting or SM setting.
+ if ( ! $settings[ $id ] ) {
+ $settings[ $id ] = '';
+
+ if ( isset( $wordpress_settings[ $id ] ) ) {
+ $settings[ $id ] = $wordpress_settings[ $id ];
+ }
+ }
+
+ // No need to escape again here, since the data will either come from WordPress podcast functions or be pre-escaped
+ // in this script (or be blank).
+}
+
/**
* Create the query for sermons.
*/
$args = array(
'post_type' => 'wpfc_sermon',
- 'posts_per_page' => intval( \SermonManager::getOption( 'podcasts_per_page' ) ) ?: 10,
+ 'posts_per_page' => $settings['podcasts_per_page'],
'meta_key' => 'sermon_date',
'meta_value_num' => time(),
'meta_compare' => '<=',
@@ -109,19 +169,19 @@
'7' => 'Spirituality',
);
-$title = esc_html( \SermonManager::getOption( 'title' ) ) ?: get_wp_title_rss();
-$link = esc_url( \SermonManager::getOption( 'website_link' ) ) ?: get_bloginfo_rss( 'url' );
-$description = esc_html( \SermonManager::getOption( 'description' ) ) ?: get_bloginfo_rss( 'description' );
-$language = esc_html( \SermonManager::getOption( 'language' ) ) ?: get_bloginfo_rss( 'language' );
+$title = $settings['title'];
+$link = $settings['website_link'];
+$description = $settings['description'];
+$language = $settings['language'];
$last_sermon_date = ! empty( $sermon_podcast_query->posts ) ? get_post_meta( $sermon_podcast_query->posts[0]->ID, 'sermon_date', true ) ?: null : null;
-$copyright = html_entity_decode( esc_html( \SermonManager::getOption( 'copyright' ) ), ENT_COMPAT, 'UTF-8' );
-$subtitle = esc_html( \SermonManager::getOption( 'itunes_subtitle' ) );
-$author = esc_html( \SermonManager::getOption( 'itunes_author' ) );
-$summary = str_replace( ' ', '', \SermonManager::getOption( 'enable_podcast_html_description' ) ? stripslashes( wpautop( wp_filter_kses( \SermonManager::getOption( 'itunes_summary' ) ) ) ) : stripslashes( wp_filter_nohtml_kses( \SermonManager::getOption( 'itunes_summary' ) ) ) );
-$owner_name = esc_html( \SermonManager::getOption( 'itunes_owner_name' ) );
-$owner_email = esc_html( \SermonManager::getOption( 'itunes_owner_email' ) );
-$cover_image_url = esc_url( \SermonManager::getOption( 'itunes_cover_image' ) );
-$subcategory = esc_attr( ! empty( $categories[ \SermonManager::getOption( 'itunes_sub_category' ) ] ) ? $categories[ \SermonManager::getOption( 'itunes_sub_category' ) ] : 'Christianity' );
+$copyright = html_entity_decode( $settings['copyright'], ENT_COMPAT, 'UTF-8' );
+$subtitle = $settings['itunes_subtitle'];
+$author = $settings['itunes_author'];
+$summary = str_replace( ' ', '', $settings['enable_podcast_html_description'] ? stripslashes( wpautop( wp_filter_kses( $settings['itunes_summary'] ) ) ) : stripslashes( wp_filter_nohtml_kses( $settings['itunes_summary'] ) ) );
+$owner_name = $settings['itunes_owner_name'];
+$owner_email = $settings['itunes_owner_email'];
+$cover_image_url = $settings['itunes_cover_image'];
+$subcategory = esc_attr( ! empty( $categories[ $settings['itunes_sub_category'] ] ) ? $categories[ $settings['itunes_sub_category'] ] : 'Christianity' );
?>
no
-
+
@@ -175,12 +235,12 @@
$speaker = $speakers_terms ? $speakers_terms[0]->name : '';
$series = strip_tags( get_the_term_list( $post->ID, 'wpfc_sermon_series', '', ', ', '' ) );
$topics = strip_tags( get_the_term_list( $post->ID, 'wpfc_sermon_topics', '', ', ', '' ) );
- $post_image = get_sermon_image_url( SermonManager::getOption( 'podcast_sermon_image_series' ) );
+ $post_image = get_sermon_image_url( $settings['podcast_sermon_image_series'] );
$post_image = str_ireplace( 'https://', 'http://', ! empty( $post_image ) ? $post_image : '' );
$audio_duration = get_post_meta( $post->ID, '_wpfc_sermon_duration', true ) ?: '0:00';
$audio_file_size = get_post_meta( $post->ID, '_wpfc_sermon_size', 'true' ) ?: 0;
$description = strip_shortcodes( get_post_meta( $post->ID, 'sermon_description', true ) );
- $description = str_replace( ' ', '', \SermonManager::getOption( 'enable_podcast_html_description' ) ? stripslashes( wpautop( wp_filter_kses( $description ) ) ) : stripslashes( wp_filter_nohtml_kses( $description ) ) );
+ $description = str_replace( ' ', '', $settings['enable_podcast_html_description'] ? stripslashes( wpautop( wp_filter_kses( $description ) ) ) : stripslashes( wp_filter_nohtml_kses( $description ) ) );
$date_preached = SM_Dates::get( 'D, d M Y H:i:s +0000', null, false, false );
$date_published = get_the_date( 'D, d M Y H:i:s +0000', $post->ID );
@@ -189,7 +249,7 @@
$audio = site_url( $audio );
}
- if ( \SermonManager::getOption( 'podtrac' ) ) {
+ if ( $settings['podtrac'] ) {
$audio = 'http://dts.podtrac.com/redirect.mp3/' . esc_url( preg_replace( '#^https?://#', '', $audio ) );
} else {
// As per RSS 2.0 spec, the enclosure URL must be HTTP only:
@@ -205,7 +265,7 @@
-
+
]]>
@@ -220,6 +280,7 @@
+