3
3
* Plugin Name: Sermon Manager for WordPress
4
4
* Plugin URI: https://www.wpforchurch.com/products/sermon-manager-for-wordpress/
5
5
* Description: Add audio and video sermons, manage speakers, series, and more.
6
- * Version: 2.15.6
6
+ * Version: 2.15.7
7
7
* Author: WP for Church
8
8
* Author URI: https://www.wpforchurch.com/
9
9
* Requires at least: 4.5
@@ -81,8 +81,10 @@ public function __construct() {
81
81
82
82
// Load translations.
83
83
add_action ( 'after_setup_theme ' , array ( $ this , 'load_translations ' ) );
84
- // Enqueue scripts & styles.
84
+ // Register & enqueue scripts & styles.
85
+ add_action ( 'wp_enqueue_scripts ' , array ( $ this , 'register_scripts_styles ' ) );
85
86
add_action ( 'wp_enqueue_scripts ' , array ( $ this , 'enqueue_scripts_styles ' ) );
87
+ add_action ( 'wp_footer ' , array ( $ this , 'register_scripts_styles ' ) );
86
88
add_action ( 'wp_footer ' , array ( $ this , 'enqueue_scripts_styles ' ) );
87
89
// Append custom classes to individual sermons.
88
90
add_filter ( 'post_class ' , array ( $ this , 'add_additional_sermon_classes ' ), 10 , 3 );
@@ -553,13 +555,6 @@ public static function enqueue_scripts_styles() {
553
555
return ;
554
556
}
555
557
556
- wp_register_script ( 'wpfc-sm-fb-player ' , SM_URL . 'assets/vendor/js/facebook-video.js ' , array (), SM_VERSION );
557
- wp_register_script ( 'wpfc-sm-plyr ' , SM_URL . 'assets/vendor/js/plyr.polyfilled ' . ( ( defined ( 'WP_DEBUG ' ) && WP_DEBUG === true ) ? '' : '.min ' ) . '.js ' , array (), '3.4.3 ' , \SermonManager::getOption ( 'player_js_footer ' ) );
558
- wp_register_script ( 'wpfc-sm-plyr-loader ' , SM_URL . 'assets/js/plyr ' . ( ( defined ( 'WP_DEBUG ' ) && WP_DEBUG === true ) ? '' : '.min ' ) . '.js ' , array ( 'wpfc-sm-plyr ' ), SM_VERSION );
559
- wp_register_script ( 'wpfc-sm-verse-script ' , SM_URL . 'assets/vendor/js/verse.js ' , array (), SM_VERSION );
560
- wp_register_style ( 'wpfc-sm-styles ' , SM_URL . 'assets/css/sermon.min.css ' , array (), SM_VERSION );
561
- wp_register_style ( 'wpfc-sm-plyr-css ' , SM_URL . 'assets/vendor/css/plyr.min.css ' , array (), '3.4.3 ' );
562
-
563
558
if ( ! ( defined ( 'SM_ENQUEUE_SCRIPTS_STYLES ' ) || 'wpfc_sermon ' === get_post_type () || is_post_type_archive ( 'wpfc_sermon ' ) )
564
559
) {
565
560
return ;
@@ -570,18 +565,14 @@ public static function enqueue_scripts_styles() {
570
565
wp_enqueue_style ( 'dashicons ' );
571
566
572
567
// Load theme-specific styling, if there's any.
573
- if ( file_exists ( SM_PATH . 'assets/css/theme-specific/ ' . get_option ( 'template ' ) . '.css ' ) ) {
574
- wp_enqueue_style ( 'wpfc-sm-style- ' . get_option ( 'template ' ), SM_URL . 'assets/css/theme-specific/ ' . get_option ( 'template ' ) . '.css ' , array ( 'wpfc-sm-styles ' ), SM_VERSION );
575
- }
568
+ wp_enqueue_style ( 'wpfc-sm-style- ' . get_option ( 'template ' ) );
576
569
577
570
do_action ( 'sm_enqueue_css ' );
578
571
do_action ( 'sm_enqueue_js ' );
579
572
}
580
573
581
574
// Load top theme-specific styling, if there's any.
582
- if ( file_exists ( get_stylesheet_directory () . '/sermon.css ' ) ) {
583
- wp_enqueue_style ( 'wpfc-sm-style-theme ' , get_stylesheet_directory_uri () . '/sermon.css ' , array ( 'wpfc-sm-styles ' ), SM_VERSION );
584
- }
575
+ wp_enqueue_style ( 'wpfc-sm-style-theme ' );
585
576
586
577
switch ( \SermonManager::getOption ( 'player ' ) ) {
587
578
case 'mediaelement ' :
@@ -740,6 +731,32 @@ public static function maybe_print_cloudflare_plyr() {
740
731
741
732
define ( 'SM_CLOUDFLARE_DONE ' , true );
742
733
}
734
+
735
+ /**
736
+ * Registers all of the scripts and styles, without enqueueing them.
737
+ *
738
+ * It will be removed in future in favor of Script_Manager class.
739
+ *
740
+ * @since 2.15.7
741
+ */
742
+ public static function register_scripts_styles () {
743
+ wp_register_script ( 'wpfc-sm-fb-player ' , SM_URL . 'assets/vendor/js/facebook-video.js ' , array (), SM_VERSION );
744
+ wp_register_script ( 'wpfc-sm-plyr ' , SM_URL . 'assets/vendor/js/plyr.polyfilled ' . ( ( defined ( 'WP_DEBUG ' ) && WP_DEBUG === true ) ? '' : '.min ' ) . '.js ' , array (), '3.4.3 ' , \SermonManager::getOption ( 'player_js_footer ' ) );
745
+ wp_register_script ( 'wpfc-sm-plyr-loader ' , SM_URL . 'assets/js/plyr ' . ( ( defined ( 'WP_DEBUG ' ) && WP_DEBUG === true ) ? '' : '.min ' ) . '.js ' , array ( 'wpfc-sm-plyr ' ), SM_VERSION );
746
+ wp_register_script ( 'wpfc-sm-verse-script ' , SM_URL . 'assets/vendor/js/verse.js ' , array (), SM_VERSION );
747
+ wp_register_style ( 'wpfc-sm-styles ' , SM_URL . 'assets/css/sermon.min.css ' , array (), SM_VERSION );
748
+ wp_register_style ( 'wpfc-sm-plyr-css ' , SM_URL . 'assets/vendor/css/plyr.min.css ' , array (), '3.4.3 ' );
749
+
750
+ // Register theme-specific styling, if there's any.
751
+ if ( file_exists ( SM_PATH . 'assets/css/theme-specific/ ' . get_option ( 'template ' ) . '.css ' ) ) {
752
+ wp_register_style ( 'wpfc-sm-style- ' . get_option ( 'template ' ), SM_URL . 'assets/css/theme-specific/ ' . get_option ( 'template ' ) . '.css ' , array ( 'wpfc-sm-styles ' ), SM_VERSION );
753
+ }
754
+
755
+ // Register top theme-specific styling, if there's any.
756
+ if ( file_exists ( get_stylesheet_directory () . '/sermon.css ' ) ) {
757
+ wp_register_style ( 'wpfc-sm-style-theme ' , get_stylesheet_directory_uri () . '/sermon.css ' , array ( 'wpfc-sm-styles ' ), SM_VERSION );
758
+ }
759
+ }
743
760
}
744
761
745
762
// Initialize Sermon Manager.
0 commit comments