Completed
Push — master ( 60090c...ef8f94 )
by Hugh
09:38 queued 06:51
created
includes/widgets/class-ssp-widget-recent-episodes.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -26,118 +26,118 @@  discard block
 block discarded – undo
26 26
 	public function __construct() {
27 27
 		/* Widget variable settings. */
28 28
 		$this->widget_cssclass = 'widget_recent_entries widget_recent_episodes';
29
-		$this->widget_description = __( 'Display a list of your most recent podcast episodes.', 'seriously-simple-podcasting' );
29
+		$this->widget_description = __ ( 'Display a list of your most recent podcast episodes.', 'seriously-simple-podcasting' );
30 30
 		$this->widget_idbase = 'ss_podcast';
31
-		$this->widget_title = __( 'Podcast: Recent Episodes', 'seriously-simple-podcasting' );
31
+		$this->widget_title = __ ( 'Podcast: Recent Episodes', 'seriously-simple-podcasting' );
32 32
 
33 33
 		/* Widget settings. */
34 34
 		$widget_ops = array( 'classname' => $this->widget_cssclass, 'description' => $this->widget_description );
35 35
 
36
-		parent::__construct('recent-podcast-episodes', $this->widget_title, $widget_ops);
36
+		parent::__construct ( 'recent-podcast-episodes', $this->widget_title, $widget_ops );
37 37
 
38 38
 		$this->alt_option_name = 'widget_recent_episodes';
39 39
 
40
-		add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
41
-		add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
-		add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
40
+		add_action ( 'save_post', array( $this, 'flush_widget_cache' ) );
41
+		add_action ( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
+		add_action ( 'switch_theme', array( $this, 'flush_widget_cache' ) );
43 43
 
44 44
 	} // End __construct()
45 45
 
46
-	public function widget($args, $instance) {
46
+	public function widget( $args, $instance ) {
47 47
 		$cache = array();
48
-		if ( ! $this->is_preview() ) {
49
-			$cache = wp_cache_get( 'widget_recent_episodes', 'widget' );
48
+		if ( ! $this->is_preview () ) {
49
+			$cache = wp_cache_get ( 'widget_recent_episodes', 'widget' );
50 50
 		}
51 51
 
52
-		if ( ! is_array( $cache ) ) {
52
+		if ( ! is_array ( $cache ) ) {
53 53
 			$cache = array();
54 54
 		}
55 55
 
56
-		if ( ! isset( $args['widget_id'] ) ) {
57
-			$args['widget_id'] = $this->id;
56
+		if ( ! isset( $args[ 'widget_id' ] ) ) {
57
+			$args[ 'widget_id' ] = $this->id;
58 58
 		}
59 59
 
60
-		if ( isset( $cache[ $args['widget_id'] ] ) ) {
61
-			echo $cache[ $args['widget_id'] ];
60
+		if ( isset( $cache[ $args[ 'widget_id' ] ] ) ) {
61
+			echo $cache[ $args[ 'widget_id' ] ];
62 62
 			return;
63 63
 		}
64 64
 
65
-		ob_start();
65
+		ob_start ();
66 66
 
67
-		$title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Episodes', 'seriously-simple-podcasting' );
67
+		$title = ( ! empty( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __ ( 'Recent Episodes', 'seriously-simple-podcasting' );
68 68
 
69 69
 		/** This filter is documented in wp-includes/default-widgets.php */
70
-		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
70
+		$title = apply_filters ( 'widget_title', $title, $instance, $this->id_base );
71 71
 
72
-		$number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;
72
+		$number = ( ! empty( $instance[ 'number' ] ) ) ? absint ( $instance[ 'number' ] ) : 5;
73 73
 		if ( ! $number ) {
74 74
 			$number = 5;
75 75
 		}
76 76
 
77
-		$show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false;
77
+		$show_date = isset( $instance[ 'show_date' ] ) ? $instance[ 'show_date' ] : false;
78 78
 
79
-		$query_args = ssp_episodes( $number, '', true, 'widget' );
79
+		$query_args = ssp_episodes ( $number, '', true, 'widget' );
80 80
 
81
-		$qry = new WP_Query( apply_filters( 'ssp_widget_recent_episodes_args', $query_args ) );
81
+		$qry = new WP_Query ( apply_filters ( 'ssp_widget_recent_episodes_args', $query_args ) );
82 82
 
83
-		if ($qry->have_posts()) :
83
+		if ( $qry->have_posts () ) :
84 84
 ?>
85
-		<?php echo $args['before_widget']; ?>
85
+		<?php echo $args[ 'before_widget' ]; ?>
86 86
 		<?php if ( $title ) {
87
-			echo $args['before_title'] . $title . $args['after_title'];
87
+			echo $args[ 'before_title' ].$title.$args[ 'after_title' ];
88 88
 		} ?>
89 89
 		<ul>
90
-		<?php while ( $qry->have_posts() ) : $qry->the_post(); ?>
90
+		<?php while ( $qry->have_posts () ) : $qry->the_post (); ?>
91 91
 			<li>
92
-				<a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?></a>
92
+				<a href="<?php the_permalink (); ?>"><?php get_the_title () ? the_title () : the_ID (); ?></a>
93 93
 			<?php if ( $show_date ) : ?>
94
-				<span class="post-date"><?php echo get_the_date(); ?></span>
94
+				<span class="post-date"><?php echo get_the_date (); ?></span>
95 95
 			<?php endif; ?>
96 96
 			</li>
97 97
 		<?php endwhile; ?>
98 98
 		</ul>
99
-		<?php echo $args['after_widget']; ?>
99
+		<?php echo $args[ 'after_widget' ]; ?>
100 100
 <?php
101 101
 		// Reset the global $the_post as this query will have stomped on it
102
-		wp_reset_postdata();
102
+		wp_reset_postdata ();
103 103
 
104 104
 		endif;
105 105
 
106
-		if ( ! $this->is_preview() ) {
107
-			$cache[ $args['widget_id'] ] = ob_get_flush();
108
-			wp_cache_set( 'widget_recent_episodes', $cache, 'widget' );
106
+		if ( ! $this->is_preview () ) {
107
+			$cache[ $args[ 'widget_id' ] ] = ob_get_flush ();
108
+			wp_cache_set ( 'widget_recent_episodes', $cache, 'widget' );
109 109
 		} else {
110
-			ob_end_flush();
110
+			ob_end_flush ();
111 111
 		}
112 112
 	}
113 113
 
114 114
 	public function update( $new_instance, $old_instance ) {
115 115
 		$instance = $old_instance;
116
-		$instance['title'] = strip_tags($new_instance['title']);
117
-		$instance['number'] = (int) $new_instance['number'];
118
-		$instance['show_date'] = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false;
119
-		$this->flush_widget_cache();
116
+		$instance[ 'title' ] = strip_tags ( $new_instance[ 'title' ] );
117
+		$instance[ 'number' ] = (int) $new_instance[ 'number' ];
118
+		$instance[ 'show_date' ] = isset( $new_instance[ 'show_date' ] ) ? (bool) $new_instance[ 'show_date' ] : false;
119
+		$this->flush_widget_cache ();
120 120
 
121 121
 		return $instance;
122 122
 	}
123 123
 
124 124
 	public function flush_widget_cache() {
125
-		wp_cache_delete('widget_recent_episodes', 'widget');
125
+		wp_cache_delete ( 'widget_recent_episodes', 'widget' );
126 126
 	}
127 127
 
128 128
 	public function form( $instance ) {
129
-		$title     = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
130
-		$number    = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;
131
-		$show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false;
129
+		$title     = isset( $instance[ 'title' ] ) ? esc_attr ( $instance[ 'title' ] ) : '';
130
+		$number    = isset( $instance[ 'number' ] ) ? absint ( $instance[ 'number' ] ) : 5;
131
+		$show_date = isset( $instance[ 'show_date' ] ) ? (bool) $instance[ 'show_date' ] : false;
132 132
 ?>
133
-		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'seriously-simple-podcasting' ); ?></label>
134
-		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
133
+		<p><label for="<?php echo $this->get_field_id ( 'title' ); ?>"><?php _e ( 'Title:', 'seriously-simple-podcasting' ); ?></label>
134
+		<input class="widefat" id="<?php echo $this->get_field_id ( 'title' ); ?>" name="<?php echo $this->get_field_name ( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
135 135
 
136
-		<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of episodes to show:', 'seriously-simple-podcasting' ); ?></label>
137
-		<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
136
+		<p><label for="<?php echo $this->get_field_id ( 'number' ); ?>"><?php _e ( 'Number of episodes to show:', 'seriously-simple-podcasting' ); ?></label>
137
+		<input id="<?php echo $this->get_field_id ( 'number' ); ?>" name="<?php echo $this->get_field_name ( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
138 138
 
139
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" />
140
-		<label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display episode date?', 'seriously-simple-podcasting' ); ?></label></p>
139
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_date ); ?> id="<?php echo $this->get_field_id ( 'show_date' ); ?>" name="<?php echo $this->get_field_name ( 'show_date' ); ?>" />
140
+		<label for="<?php echo $this->get_field_id ( 'show_date' ); ?>"><?php _e ( 'Display episode date?', 'seriously-simple-podcasting' ); ?></label></p>
141 141
 <?php
142 142
 	}
143 143
 } // End Class
Please login to merge, or discard this patch.
includes/widgets/class-ssp-widget-series.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -26,74 +26,74 @@  discard block
 block discarded – undo
26 26
 	public function __construct() {
27 27
 		/* Widget variable settings. */
28 28
 		$this->widget_cssclass = 'widget_podcast_series';
29
-		$this->widget_description = __( 'Display a list of episodes from a single series.', 'seriously-simple-podcasting' );
29
+		$this->widget_description = __ ( 'Display a list of episodes from a single series.', 'seriously-simple-podcasting' );
30 30
 		$this->widget_idbase = 'ss_podcast';
31
-		$this->widget_title = __( 'Podcast: Series', 'seriously-simple-podcasting' );
31
+		$this->widget_title = __ ( 'Podcast: Series', 'seriously-simple-podcasting' );
32 32
 
33 33
 		/* Widget settings. */
34 34
 		$widget_ops = array( 'classname' => $this->widget_cssclass, 'description' => $this->widget_description );
35 35
 
36
-		parent::__construct('podcast-series', $this->widget_title, $widget_ops);
36
+		parent::__construct ( 'podcast-series', $this->widget_title, $widget_ops );
37 37
 
38 38
 		$this->alt_option_name = 'widget_podcast_series';
39 39
 
40
-		add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
41
-		add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
-		add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
40
+		add_action ( 'save_post', array( $this, 'flush_widget_cache' ) );
41
+		add_action ( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
+		add_action ( 'switch_theme', array( $this, 'flush_widget_cache' ) );
43 43
 
44 44
 	} // End __construct()
45 45
 
46
-	public function widget($args, $instance) {
46
+	public function widget( $args, $instance ) {
47 47
 		$cache = array();
48
-		if ( ! $this->is_preview() ) {
49
-			$cache = wp_cache_get( 'widget_podcast_series', 'widget' );
48
+		if ( ! $this->is_preview () ) {
49
+			$cache = wp_cache_get ( 'widget_podcast_series', 'widget' );
50 50
 		}
51 51
 
52
-		if ( ! is_array( $cache ) ) {
52
+		if ( ! is_array ( $cache ) ) {
53 53
 			$cache = array();
54 54
 		}
55 55
 
56
-		if ( ! isset( $args['widget_id'] ) ) {
57
-			$args['widget_id'] = $this->id;
56
+		if ( ! isset( $args[ 'widget_id' ] ) ) {
57
+			$args[ 'widget_id' ] = $this->id;
58 58
 		}
59 59
 
60
-		if ( isset( $cache[ $args['widget_id'] ] ) ) {
61
-			echo $cache[ $args['widget_id'] ];
60
+		if ( isset( $cache[ $args[ 'widget_id' ] ] ) ) {
61
+			echo $cache[ $args[ 'widget_id' ] ];
62 62
 			return;
63 63
 		}
64 64
 
65
-		ob_start();
65
+		ob_start ();
66 66
 
67
-		$series_id = $instance['series_id'];
67
+		$series_id = $instance[ 'series_id' ];
68 68
 
69 69
 		if ( ! $series_id ) {
70 70
 			return;
71 71
 		}
72 72
 
73
-		$series = get_term( $series_id, 'series' );
73
+		$series = get_term ( $series_id, 'series' );
74 74
 
75
-		if ( ! $series || is_wp_error( $series ) ) {
75
+		if ( ! $series || is_wp_error ( $series ) ) {
76 76
 			return;
77 77
 		}
78 78
 
79
-		$title = ( $instance['title'] ) ? $instance['title'] : $series->name;
79
+		$title = ( $instance[ 'title' ] ) ? $instance[ 'title' ] : $series->name;
80 80
 
81 81
 		/** This filter is documented in wp-includes/default-widgets.php */
82
-		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
82
+		$title = apply_filters ( 'widget_title', $title, $instance, $this->id_base );
83 83
 
84
-		$show_title = isset( $instance['show_title'] ) ? $instance['show_title'] : false;
85
-		$show_desc = isset( $instance['show_desc'] ) ? $instance['show_desc'] : false;
86
-		$show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false;
84
+		$show_title = isset( $instance[ 'show_title' ] ) ? $instance[ 'show_title' ] : false;
85
+		$show_desc = isset( $instance[ 'show_desc' ] ) ? $instance[ 'show_desc' ] : false;
86
+		$show_date = isset( $instance[ 'show_date' ] ) ? $instance[ 'show_date' ] : false;
87 87
 
88
-		$query_args = ssp_episodes( 999, $series->slug, true, 'widget' );
88
+		$query_args = ssp_episodes ( 999, $series->slug, true, 'widget' );
89 89
 
90
-		$qry = new WP_Query( apply_filters( 'ssp_widget_series_episodes_args', $query_args ) );
90
+		$qry = new WP_Query ( apply_filters ( 'ssp_widget_series_episodes_args', $query_args ) );
91 91
 
92
-		if ( $qry->have_posts() ) :
92
+		if ( $qry->have_posts () ) :
93 93
 ?>
94
-		<?php echo $args['before_widget']; ?>
94
+		<?php echo $args[ 'before_widget' ]; ?>
95 95
 		<?php if ( $title ) {
96
-			echo $args['before_title'] . $title . $args['after_title'];
96
+			echo $args[ 'before_title' ].$title.$args[ 'after_title' ];
97 97
 		} ?>
98 98
 
99 99
 		<?php if ( $show_title ) { ?>
@@ -105,77 +105,77 @@  discard block
 block discarded – undo
105 105
 		<?php } ?>
106 106
 
107 107
 		<ul>
108
-		<?php while ( $qry->have_posts() ) : $qry->the_post(); ?>
108
+		<?php while ( $qry->have_posts () ) : $qry->the_post (); ?>
109 109
 			<li>
110
-				<a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?></a>
110
+				<a href="<?php the_permalink (); ?>"><?php get_the_title () ? the_title () : the_ID (); ?></a>
111 111
 			<?php if ( $show_date ) : ?>
112
-				<span class="post-date"><?php echo get_the_date(); ?></span>
112
+				<span class="post-date"><?php echo get_the_date (); ?></span>
113 113
 			<?php endif; ?>
114 114
 			</li>
115 115
 		<?php endwhile; ?>
116 116
 		</ul>
117
-		<?php echo $args['after_widget']; ?>
117
+		<?php echo $args[ 'after_widget' ]; ?>
118 118
 <?php
119 119
 		// Reset the global $the_post as this query will have stomped on it
120
-		wp_reset_postdata();
120
+		wp_reset_postdata ();
121 121
 
122 122
 		endif;
123 123
 
124
-		if ( ! $this->is_preview() ) {
125
-			$cache[ $args['widget_id'] ] = ob_get_flush();
126
-			wp_cache_set( 'widget_podcast_series', $cache, 'widget' );
124
+		if ( ! $this->is_preview () ) {
125
+			$cache[ $args[ 'widget_id' ] ] = ob_get_flush ();
126
+			wp_cache_set ( 'widget_podcast_series', $cache, 'widget' );
127 127
 		} else {
128
-			ob_end_flush();
128
+			ob_end_flush ();
129 129
 		}
130 130
 	}
131 131
 
132 132
 	public function update( $new_instance, $old_instance ) {
133 133
 		$instance = $old_instance;
134
-		$instance['title'] 		= strip_tags( $new_instance['title'] );
135
-		$instance['series_id']  = isset( $new_instance['series_id'] ) ? (int) $new_instance['series_id'] : 0;
136
-		$instance['show_title'] = isset( $new_instance['show_title'] ) ? (bool) $new_instance['show_title'] : false;
137
-		$instance['show_desc']  = isset( $new_instance['show_desc'] ) ? (bool) $new_instance['show_desc'] : false;
138
-		$instance['show_date']  = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false;
139
-		$this->flush_widget_cache();
134
+		$instance[ 'title' ] = strip_tags ( $new_instance[ 'title' ] );
135
+		$instance[ 'series_id' ]  = isset( $new_instance[ 'series_id' ] ) ? (int) $new_instance[ 'series_id' ] : 0;
136
+		$instance[ 'show_title' ] = isset( $new_instance[ 'show_title' ] ) ? (bool) $new_instance[ 'show_title' ] : false;
137
+		$instance[ 'show_desc' ]  = isset( $new_instance[ 'show_desc' ] ) ? (bool) $new_instance[ 'show_desc' ] : false;
138
+		$instance[ 'show_date' ]  = isset( $new_instance[ 'show_date' ] ) ? (bool) $new_instance[ 'show_date' ] : false;
139
+		$this->flush_widget_cache ();
140 140
 
141 141
 		return $instance;
142 142
 	}
143 143
 
144 144
 	public function flush_widget_cache() {
145
-		wp_cache_delete('widget_podcast_series', 'widget');
145
+		wp_cache_delete ( 'widget_podcast_series', 'widget' );
146 146
 	}
147 147
 
148 148
 	public function form( $instance ) {
149
-		$title        = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
150
-		$series_id    = isset( $instance['series_id'] ) ? $instance['series_id'] : 0;
151
-		$show_title   = isset( $instance['show_title'] ) ? (bool) $instance['show_title'] : false;
152
-		$show_desc    = isset( $instance['show_desc'] ) ? (bool) $instance['show_desc'] : false;
153
-		$show_date    = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false;
149
+		$title        = isset( $instance[ 'title' ] ) ? esc_attr ( $instance[ 'title' ] ) : '';
150
+		$series_id    = isset( $instance[ 'series_id' ] ) ? $instance[ 'series_id' ] : 0;
151
+		$show_title   = isset( $instance[ 'show_title' ] ) ? (bool) $instance[ 'show_title' ] : false;
152
+		$show_desc    = isset( $instance[ 'show_desc' ] ) ? (bool) $instance[ 'show_desc' ] : false;
153
+		$show_date    = isset( $instance[ 'show_date' ] ) ? (bool) $instance[ 'show_date' ] : false;
154 154
 
155 155
 		// Get all podcast series
156
-		$series = get_terms( 'series' );
156
+		$series = get_terms ( 'series' );
157 157
 ?>
158
-		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'seriously-simple-podcasting' ); ?></label>
159
-		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" placeholder="<?php _e( 'Use series title', 'seriously-simple-podcasting' ); ?>" value="<?php echo $title; ?>" /></p>
158
+		<p><label for="<?php echo $this->get_field_id ( 'title' ); ?>"><?php _e ( 'Title:', 'seriously-simple-podcasting' ); ?></label>
159
+		<input class="widefat" id="<?php echo $this->get_field_id ( 'title' ); ?>" name="<?php echo $this->get_field_name ( 'title' ); ?>" type="text" placeholder="<?php _e ( 'Use series title', 'seriously-simple-podcasting' ); ?>" value="<?php echo $title; ?>" /></p>
160 160
 
161
-		<p><label for="<?php echo $this->get_field_id( 'series_id' ); ?>"><?php _e( 'Series:', 'seriously-simple-podcasting' ); ?></label>
162
-		<select id="<?php echo $this->get_field_id( 'series_id' ); ?>" name="<?php echo $this->get_field_name( 'series_id' ); ?>">
161
+		<p><label for="<?php echo $this->get_field_id ( 'series_id' ); ?>"><?php _e ( 'Series:', 'seriously-simple-podcasting' ); ?></label>
162
+		<select id="<?php echo $this->get_field_id ( 'series_id' ); ?>" name="<?php echo $this->get_field_name ( 'series_id' ); ?>">
163 163
 			<?php
164 164
 			foreach ( $series as $s ) {
165
-				echo '<option value="' . esc_attr( $s->term_id ) . '" ' . selected( $series_id, $s->term_id, false ) . '>' . $s->name . '</option>' . "\n";
165
+				echo '<option value="'.esc_attr ( $s->term_id ).'" '.selected ( $series_id, $s->term_id, false ).'>'.$s->name.'</option>'."\n";
166 166
 			}
167 167
 			?>
168 168
 		</select>
169 169
 		</p>
170 170
 
171
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_title ); ?> id="<?php echo $this->get_field_id( 'show_title' ); ?>" name="<?php echo $this->get_field_name( 'show_title' ); ?>" />
172
-		<label for="<?php echo $this->get_field_id( 'show_title' ); ?>"><?php _e( 'Display series title inside widget?', 'seriously-simple-podcasting' ); ?></label></p>
171
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_title ); ?> id="<?php echo $this->get_field_id ( 'show_title' ); ?>" name="<?php echo $this->get_field_name ( 'show_title' ); ?>" />
172
+		<label for="<?php echo $this->get_field_id ( 'show_title' ); ?>"><?php _e ( 'Display series title inside widget?', 'seriously-simple-podcasting' ); ?></label></p>
173 173
 
174
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_desc ); ?> id="<?php echo $this->get_field_id( 'show_desc' ); ?>" name="<?php echo $this->get_field_name( 'show_desc' ); ?>" />
175
-		<label for="<?php echo $this->get_field_id( 'show_desc' ); ?>"><?php _e( 'Display series description?', 'seriously-simple-podcasting' ); ?></label></p>
174
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_desc ); ?> id="<?php echo $this->get_field_id ( 'show_desc' ); ?>" name="<?php echo $this->get_field_name ( 'show_desc' ); ?>" />
175
+		<label for="<?php echo $this->get_field_id ( 'show_desc' ); ?>"><?php _e ( 'Display series description?', 'seriously-simple-podcasting' ); ?></label></p>
176 176
 
177
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" />
178
-		<label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display episode date?', 'seriously-simple-podcasting' ); ?></label></p>
177
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_date ); ?> id="<?php echo $this->get_field_id ( 'show_date' ); ?>" name="<?php echo $this->get_field_name ( 'show_date' ); ?>" />
178
+		<label for="<?php echo $this->get_field_id ( 'show_date' ); ?>"><?php _e ( 'Display episode date?', 'seriously-simple-podcasting' ); ?></label></p>
179 179
 <?php
180 180
 	}
181 181
 } // End Class
Please login to merge, or discard this patch.
includes/widgets/class-ssp-widget-single-episode.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -26,20 +26,20 @@  discard block
 block discarded – undo
26 26
 	public function __construct() {
27 27
 		/* Widget variable settings. */
28 28
 		$this->widget_cssclass = 'widget_podcast_episode';
29
-		$this->widget_description = __( 'Display a single podcast episode.', 'seriously-simple-podcasting' );
29
+		$this->widget_description = __ ( 'Display a single podcast episode.', 'seriously-simple-podcasting' );
30 30
 		$this->widget_idbase = 'ss_podcast';
31
-		$this->widget_title = __( 'Podcast: Single Episode', 'seriously-simple-podcasting' );
31
+		$this->widget_title = __ ( 'Podcast: Single Episode', 'seriously-simple-podcasting' );
32 32
 
33 33
 		/* Widget settings. */
34 34
 		$widget_ops = array( 'classname' => $this->widget_cssclass, 'description' => $this->widget_description );
35 35
 
36
-		parent::__construct('single-podcast-episode', $this->widget_title, $widget_ops);
36
+		parent::__construct ( 'single-podcast-episode', $this->widget_title, $widget_ops );
37 37
 
38 38
 		$this->alt_option_name = 'widget_single_episode';
39 39
 
40
-		add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
41
-		add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
-		add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
40
+		add_action ( 'save_post', array( $this, 'flush_widget_cache' ) );
41
+		add_action ( 'deleted_post', array( $this, 'flush_widget_cache' ) );
42
+		add_action ( 'switch_theme', array( $this, 'flush_widget_cache' ) );
43 43
 
44 44
 	} // End __construct()
45 45
 
@@ -47,157 +47,157 @@  discard block
 block discarded – undo
47 47
 		global $ss_podcasting;
48 48
 
49 49
 		$cache = array();
50
-		if ( ! $this->is_preview() ) {
51
-			$cache = wp_cache_get( 'widget_single_episode', 'widget' );
50
+		if ( ! $this->is_preview () ) {
51
+			$cache = wp_cache_get ( 'widget_single_episode', 'widget' );
52 52
 		}
53 53
 
54
-		if ( ! is_array( $cache ) ) {
54
+		if ( ! is_array ( $cache ) ) {
55 55
 			$cache = array();
56 56
 		}
57 57
 
58
-		if ( ! isset( $args['widget_id'] ) ) {
59
-			$args['widget_id'] = $this->id;
58
+		if ( ! isset( $args[ 'widget_id' ] ) ) {
59
+			$args[ 'widget_id' ] = $this->id;
60 60
 		}
61 61
 
62
-		if ( isset( $cache[ $args['widget_id'] ] ) ) {
63
-			echo $cache[ $args['widget_id'] ];
62
+		if ( isset( $cache[ $args[ 'widget_id' ] ] ) ) {
63
+			echo $cache[ $args[ 'widget_id' ] ];
64 64
 			return;
65 65
 		}
66 66
 
67
-		ob_start();
67
+		ob_start ();
68 68
 
69
-		$episode_id = $instance['episode_id'];
69
+		$episode_id = $instance[ 'episode_id' ];
70 70
 
71
-		if( 0 == $episode_id ) {
72
-			$ssp_episodes = ssp_episodes( 1 );
73
-			if( 0 < count( $ssp_episodes ) ) {
74
-				foreach( $ssp_episodes as $episode ) {
71
+		if ( 0 == $episode_id ) {
72
+			$ssp_episodes = ssp_episodes ( 1 );
73
+			if ( 0 < count ( $ssp_episodes ) ) {
74
+				foreach ( $ssp_episodes as $episode ) {
75 75
 					$episode_id = $episode->ID;
76 76
 					break;
77 77
 				}
78 78
 			}
79 79
 		}
80 80
 
81
-		if( ! $episode_id ) {
81
+		if ( ! $episode_id ) {
82 82
 			return;
83 83
 		}
84 84
 
85
-		$title = ( $instance['title'] ) ? $instance['title'] : get_the_title( $episode_id );
85
+		$title = ( $instance[ 'title' ] ) ? $instance[ 'title' ] : get_the_title ( $episode_id );
86 86
 
87 87
 		/** This filter is documented in wp-includes/default-widgets.php */
88
-		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
88
+		$title = apply_filters ( 'widget_title', $title, $instance, $this->id_base );
89 89
 
90
-		$show_title = isset( $instance['show_title'] ) ? $instance['show_title'] : false;
91
-		$show_excerpt = isset( $instance['show_excerpt'] ) ? $instance['show_excerpt'] : false;
92
-		$show_content = isset( $instance['show_content'] ) ? $instance['show_content'] : false;
93
-		$show_player = isset( $instance['show_player'] ) ? $instance['show_player'] : false;
94
-		$show_details = isset( $instance['show_details'] ) ? $instance['show_details'] : false;
90
+		$show_title = isset( $instance[ 'show_title' ] ) ? $instance[ 'show_title' ] : false;
91
+		$show_excerpt = isset( $instance[ 'show_excerpt' ] ) ? $instance[ 'show_excerpt' ] : false;
92
+		$show_content = isset( $instance[ 'show_content' ] ) ? $instance[ 'show_content' ] : false;
93
+		$show_player = isset( $instance[ 'show_player' ] ) ? $instance[ 'show_player' ] : false;
94
+		$show_details = isset( $instance[ 'show_details' ] ) ? $instance[ 'show_details' ] : false;
95 95
 
96 96
 		$content_items = array();
97 97
 
98 98
 		if ( $show_title ) {
99
-			$content_items[] = 'title';
99
+			$content_items[ ] = 'title';
100 100
 		}
101 101
 
102 102
 		if ( $show_excerpt ) {
103
-			$content_items[] = 'excerpt';
103
+			$content_items[ ] = 'excerpt';
104 104
 		}
105 105
 
106 106
 		if ( $show_content ) {
107
-			$content_items[] = 'content';
107
+			$content_items[ ] = 'content';
108 108
 		}
109 109
 
110 110
 		if ( $show_player ) {
111
-			$content_items[] = 'player';
111
+			$content_items[ ] = 'player';
112 112
 		}
113 113
 
114 114
 		if ( $show_details ) {
115
-			$content_items[] = 'details';
115
+			$content_items[ ] = 'details';
116 116
 		}
117 117
 
118 118
 		// Get episode markup
119
-		$html = $ss_podcasting->podcast_episode( $episode_id, $content_items, 'widget' );
119
+		$html = $ss_podcasting->podcast_episode ( $episode_id, $content_items, 'widget' );
120 120
 
121 121
 		if ( ! $html ) {
122 122
 			return;
123 123
 		}
124 124
 
125
-		echo $args['before_widget'];
125
+		echo $args[ 'before_widget' ];
126 126
 
127 127
 		if ( $title ) {
128
-			echo $args['before_title'] . $title . $args['after_title'];
128
+			echo $args[ 'before_title' ].$title.$args[ 'after_title' ];
129 129
 		}
130 130
 
131 131
 		echo $html;
132 132
 
133
-		echo $args['after_widget'];
133
+		echo $args[ 'after_widget' ];
134 134
 
135
-		if ( ! $this->is_preview() ) {
136
-			$cache[ $args['widget_id'] ] = ob_get_flush();
137
-			wp_cache_set( 'widget_single_episode', $cache, 'widget' );
135
+		if ( ! $this->is_preview () ) {
136
+			$cache[ $args[ 'widget_id' ] ] = ob_get_flush ();
137
+			wp_cache_set ( 'widget_single_episode', $cache, 'widget' );
138 138
 		} else {
139
-			ob_end_flush();
139
+			ob_end_flush ();
140 140
 		}
141 141
 	}
142 142
 
143 143
 	public function update( $new_instance, $old_instance ) {
144 144
 		$instance = $old_instance;
145
-		$instance['title'] 		  = strip_tags( $new_instance['title'] );
146
-		$instance['episode_id']   = isset( $new_instance['episode_id'] ) ? (int) $new_instance['episode_id'] : 0;
147
-		$instance['show_title']   = isset( $new_instance['show_title'] ) ? (bool) $new_instance['show_title'] : false;
148
-		$instance['show_excerpt'] = isset( $new_instance['show_excerpt'] ) ? (bool) $new_instance['show_excerpt'] : false;
149
-		$instance['show_content'] = isset( $new_instance['show_content'] ) ? (bool) $new_instance['show_content'] : false;
150
-		$instance['show_player']  = isset( $new_instance['show_player'] ) ? (bool) $new_instance['show_player'] : false;
151
-		$instance['show_details'] = isset( $new_instance['show_details'] ) ? (bool) $new_instance['show_details'] : false;
152
-		$this->flush_widget_cache();
145
+		$instance[ 'title' ] = strip_tags ( $new_instance[ 'title' ] );
146
+		$instance[ 'episode_id' ]   = isset( $new_instance[ 'episode_id' ] ) ? (int) $new_instance[ 'episode_id' ] : 0;
147
+		$instance[ 'show_title' ]   = isset( $new_instance[ 'show_title' ] ) ? (bool) $new_instance[ 'show_title' ] : false;
148
+		$instance[ 'show_excerpt' ] = isset( $new_instance[ 'show_excerpt' ] ) ? (bool) $new_instance[ 'show_excerpt' ] : false;
149
+		$instance[ 'show_content' ] = isset( $new_instance[ 'show_content' ] ) ? (bool) $new_instance[ 'show_content' ] : false;
150
+		$instance[ 'show_player' ]  = isset( $new_instance[ 'show_player' ] ) ? (bool) $new_instance[ 'show_player' ] : false;
151
+		$instance[ 'show_details' ] = isset( $new_instance[ 'show_details' ] ) ? (bool) $new_instance[ 'show_details' ] : false;
152
+		$this->flush_widget_cache ();
153 153
 
154 154
 		return $instance;
155 155
 	}
156 156
 
157 157
 	public function flush_widget_cache() {
158
-		wp_cache_delete('widget_single_episode', 'widget');
158
+		wp_cache_delete ( 'widget_single_episode', 'widget' );
159 159
 	}
160 160
 
161 161
 	public function form( $instance ) {
162
-		$title     	  = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
163
-		$episode_id   = isset( $instance['episode_id'] ) ? $instance['episode_id'] : 0;
164
-		$show_title   = isset( $instance['show_title'] ) ? (bool) $instance['show_title'] : false;
165
-		$show_excerpt = isset( $instance['show_excerpt'] ) ? (bool) $instance['show_excerpt'] : false;
166
-		$show_content = isset( $instance['show_content'] ) ? (bool) $instance['show_content'] : false;
167
-		$show_player  = isset( $instance['show_player'] ) ? (bool) $instance['show_player'] : false;
168
-		$show_details = isset( $instance['show_details'] ) ? (bool) $instance['show_details'] : false;
162
+		$title     	  = isset( $instance[ 'title' ] ) ? esc_attr ( $instance[ 'title' ] ) : '';
163
+		$episode_id   = isset( $instance[ 'episode_id' ] ) ? $instance[ 'episode_id' ] : 0;
164
+		$show_title   = isset( $instance[ 'show_title' ] ) ? (bool) $instance[ 'show_title' ] : false;
165
+		$show_excerpt = isset( $instance[ 'show_excerpt' ] ) ? (bool) $instance[ 'show_excerpt' ] : false;
166
+		$show_content = isset( $instance[ 'show_content' ] ) ? (bool) $instance[ 'show_content' ] : false;
167
+		$show_player  = isset( $instance[ 'show_player' ] ) ? (bool) $instance[ 'show_player' ] : false;
168
+		$show_details = isset( $instance[ 'show_details' ] ) ? (bool) $instance[ 'show_details' ] : false;
169 169
 
170 170
 		// Get all podcast episodes
171
-		$episode_ids = (array) ssp_episode_ids();
171
+		$episode_ids = (array) ssp_episode_ids ();
172 172
 ?>
173
-		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'seriously-simple-podcasting' ); ?></label>
174
-		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" placeholder="<?php _e( 'Use episode title', 'seriously-simple-podcasting' ); ?>" value="<?php echo $title; ?>" /></p>
173
+		<p><label for="<?php echo $this->get_field_id ( 'title' ); ?>"><?php _e ( 'Title:', 'seriously-simple-podcasting' ); ?></label>
174
+		<input class="widefat" id="<?php echo $this->get_field_id ( 'title' ); ?>" name="<?php echo $this->get_field_name ( 'title' ); ?>" type="text" placeholder="<?php _e ( 'Use episode title', 'seriously-simple-podcasting' ); ?>" value="<?php echo $title; ?>" /></p>
175 175
 
176
-		<p><label for="<?php echo $this->get_field_id( 'episode_id' ); ?>"><?php _e( 'Episode:', 'seriously-simple-podcasting' ); ?></label>
177
-		<select id="<?php echo $this->get_field_id( 'episode_id' ); ?>" name="<?php echo $this->get_field_name( 'episode_id' ); ?>">
178
-			<option value="0"><?php _e( '- Latest episode -', 'seriously-simple-podcasting' ); ?></option>
176
+		<p><label for="<?php echo $this->get_field_id ( 'episode_id' ); ?>"><?php _e ( 'Episode:', 'seriously-simple-podcasting' ); ?></label>
177
+		<select id="<?php echo $this->get_field_id ( 'episode_id' ); ?>" name="<?php echo $this->get_field_name ( 'episode_id' ); ?>">
178
+			<option value="0"><?php _e ( '- Latest episode -', 'seriously-simple-podcasting' ); ?></option>
179 179
 			<?php
180 180
 			foreach ( $episode_ids as $id ) {
181
-				echo '<option value="' . esc_attr( $id ) . '" ' . selected( $episode_id, $id, false ) . '>' . get_the_title( $id ) . '</option>' . "\n";
181
+				echo '<option value="'.esc_attr ( $id ).'" '.selected ( $episode_id, $id, false ).'>'.get_the_title ( $id ).'</option>'."\n";
182 182
 			}
183 183
 			?>
184 184
 		</select>
185 185
 		</p>
186 186
 
187
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_title ); ?> id="<?php echo $this->get_field_id( 'show_title' ); ?>" name="<?php echo $this->get_field_name( 'show_title' ); ?>" />
188
-		<label for="<?php echo $this->get_field_id( 'show_title' ); ?>"><?php _e( 'Display episode title inside widget?', 'seriously-simple-podcasting' ); ?></label></p>
187
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_title ); ?> id="<?php echo $this->get_field_id ( 'show_title' ); ?>" name="<?php echo $this->get_field_name ( 'show_title' ); ?>" />
188
+		<label for="<?php echo $this->get_field_id ( 'show_title' ); ?>"><?php _e ( 'Display episode title inside widget?', 'seriously-simple-podcasting' ); ?></label></p>
189 189
 
190
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_excerpt ); ?> id="<?php echo $this->get_field_id( 'show_excerpt' ); ?>" name="<?php echo $this->get_field_name( 'show_excerpt' ); ?>" />
191
-		<label for="<?php echo $this->get_field_id( 'show_excerpt' ); ?>"><?php _e( 'Display episode excerpt?', 'seriously-simple-podcasting' ); ?></label></p>
190
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_excerpt ); ?> id="<?php echo $this->get_field_id ( 'show_excerpt' ); ?>" name="<?php echo $this->get_field_name ( 'show_excerpt' ); ?>" />
191
+		<label for="<?php echo $this->get_field_id ( 'show_excerpt' ); ?>"><?php _e ( 'Display episode excerpt?', 'seriously-simple-podcasting' ); ?></label></p>
192 192
 
193
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_content ); ?> id="<?php echo $this->get_field_id( 'show_content' ); ?>" name="<?php echo $this->get_field_name( 'show_content' ); ?>" />
194
-		<label for="<?php echo $this->get_field_id( 'show_content' ); ?>"><?php _e( 'Display full episode content?', 'seriously-simple-podcasting' ); ?></label></p>
193
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_content ); ?> id="<?php echo $this->get_field_id ( 'show_content' ); ?>" name="<?php echo $this->get_field_name ( 'show_content' ); ?>" />
194
+		<label for="<?php echo $this->get_field_id ( 'show_content' ); ?>"><?php _e ( 'Display full episode content?', 'seriously-simple-podcasting' ); ?></label></p>
195 195
 
196
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_player ); ?> id="<?php echo $this->get_field_id( 'show_player' ); ?>" name="<?php echo $this->get_field_name( 'show_player' ); ?>" />
197
-		<label for="<?php echo $this->get_field_id( 'show_player' ); ?>"><?php _e( 'Display episode audio player?', 'seriously-simple-podcasting' ); ?></label></p>
196
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_player ); ?> id="<?php echo $this->get_field_id ( 'show_player' ); ?>" name="<?php echo $this->get_field_name ( 'show_player' ); ?>" />
197
+		<label for="<?php echo $this->get_field_id ( 'show_player' ); ?>"><?php _e ( 'Display episode audio player?', 'seriously-simple-podcasting' ); ?></label></p>
198 198
 
199
-		<p><input class="checkbox" type="checkbox" <?php checked( $show_details ); ?> id="<?php echo $this->get_field_id( 'show_details' ); ?>" name="<?php echo $this->get_field_name( 'show_details' ); ?>" />
200
-		<label for="<?php echo $this->get_field_id( 'show_details' ); ?>"><?php _e( 'Display episode details?', 'seriously-simple-podcasting' ); ?></label></p>
199
+		<p><input class="checkbox" type="checkbox" <?php checked ( $show_details ); ?> id="<?php echo $this->get_field_id ( 'show_details' ); ?>" name="<?php echo $this->get_field_name ( 'show_details' ); ?>" />
200
+		<label for="<?php echo $this->get_field_id ( 'show_details' ); ?>"><?php _e ( 'Display episode details?', 'seriously-simple-podcasting' ); ?></label></p>
201 201
 <?php
202 202
 	}
203 203
 } // End Class
Please login to merge, or discard this patch.
templates/feed-podcast.php 1 patch
Spacing   +165 added lines, -165 removed lines patch added patch discarded remove patch
@@ -7,20 +7,20 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 // Exit if accessed directly.
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if ( ! defined ( 'ABSPATH' ) ) {
11 11
 	exit;
12 12
 }
13 13
 
14 14
 global $ss_podcasting, $wp_query;
15 15
 
16 16
 // Hide all errors
17
-error_reporting( 0 );
17
+error_reporting ( 0 );
18 18
 
19 19
 // Allow feed access by default
20 20
 $give_access = true;
21 21
 
22 22
 // Check if feed is password protected
23
-$protection = get_option( 'ss_podcasting_protect', '' );
23
+$protection = get_option ( 'ss_podcasting_protect', '' );
24 24
 
25 25
 // Handle feed protection if required
26 26
 if ( $protection && $protection == 'on' ) {
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
 	$give_access = false;
29 29
 
30 30
 	// Request password and give access if correct
31
-	if ( ! isset( $_SERVER['PHP_AUTH_USER'] ) && ! isset( $_SERVER['PHP_AUTH_PW'] ) ) {
31
+	if ( ! isset( $_SERVER[ 'PHP_AUTH_USER' ] ) && ! isset( $_SERVER[ 'PHP_AUTH_PW' ] ) ) {
32 32
 	    $give_access = false;
33 33
 	} else {
34
-		$username = get_option( 'ss_podcasting_protection_username' );
35
-		$password = get_option( 'ss_podcasting_protection_password' );
34
+		$username = get_option ( 'ss_podcasting_protection_username' );
35
+		$password = get_option ( 'ss_podcasting_protection_password' );
36 36
 
37
-		if ( $_SERVER['PHP_AUTH_USER'] == $username ) {
38
-			if ( md5( $_SERVER['PHP_AUTH_PW'] ) == $password ) {
37
+		if ( $_SERVER[ 'PHP_AUTH_USER' ] == $username ) {
38
+			if ( md5 ( $_SERVER[ 'PHP_AUTH_PW' ] ) == $password ) {
39 39
 				$give_access = true;
40 40
 			}
41 41
 		}
@@ -44,168 +44,168 @@  discard block
 block discarded – undo
44 44
 
45 45
 // Get specified podcast series
46 46
 $podcast_series = '';
47
-if ( isset( $_GET['podcast_series'] ) && $_GET['podcast_series'] ) {
48
-	$podcast_series = esc_attr( $_GET['podcast_series'] );
49
-} elseif ( isset( $wp_query->query_vars['podcast_series'] ) && $wp_query->query_vars['podcast_series'] ) {
50
-	$podcast_series = esc_attr( $wp_query->query_vars['podcast_series'] );
47
+if ( isset( $_GET[ 'podcast_series' ] ) && $_GET[ 'podcast_series' ] ) {
48
+	$podcast_series = esc_attr ( $_GET[ 'podcast_series' ] );
49
+} elseif ( isset( $wp_query->query_vars[ 'podcast_series' ] ) && $wp_query->query_vars[ 'podcast_series' ] ) {
50
+	$podcast_series = esc_attr ( $wp_query->query_vars[ 'podcast_series' ] );
51 51
 }
52 52
 
53 53
 // Get series ID
54 54
 $series_id = 0;
55 55
 if ( $podcast_series ) {
56
-	$series = get_term_by( 'slug', $podcast_series, 'series' );
56
+	$series = get_term_by ( 'slug', $podcast_series, 'series' );
57 57
 	$series_id = $series->term_id;
58 58
 }
59 59
 
60 60
 // Allow dynamic access control
61
-$give_access = apply_filters( 'ssp_feed_access', $give_access, $series_id );
61
+$give_access = apply_filters ( 'ssp_feed_access', $give_access, $series_id );
62 62
 
63 63
 // Send 401 status and display no access message if access has been denied
64 64
 if ( ! $give_access ) {
65 65
 
66 66
 	// Set default message
67
-	$message = __( 'You are not permitted to view this podcast feed.' , 'seriously-simple-podcasting' );
67
+	$message = __ ( 'You are not permitted to view this podcast feed.', 'seriously-simple-podcasting' );
68 68
 
69 69
 	// Check message option from plugin settings
70
-	$message_option = get_option('ss_podcasting_protection_no_access_message');
70
+	$message_option = get_option ( 'ss_podcasting_protection_no_access_message' );
71 71
 	if ( $message_option ) {
72 72
 		$message = $message_option;
73 73
 	}
74 74
 
75 75
 	// Allow message to be filtered dynamically
76
-	$message = apply_filters( 'ssp_feed_no_access_message', $message );
76
+	$message = apply_filters ( 'ssp_feed_no_access_message', $message );
77 77
 
78
-	$no_access_message = '<div style="text-align:center;font-family:sans-serif;border:1px solid red;background:pink;padding:20px 0;color:red;">' . $message . '</div>';
78
+	$no_access_message = '<div style="text-align:center;font-family:sans-serif;border:1px solid red;background:pink;padding:20px 0;color:red;">'.$message.'</div>';
79 79
 
80
-	header('WWW-Authenticate: Basic realm="Podcast Feed"');
81
-    header('HTTP/1.0 401 Unauthorized');
80
+	header ( 'WWW-Authenticate: Basic realm="Podcast Feed"' );
81
+    header ( 'HTTP/1.0 401 Unauthorized' );
82 82
 
83 83
 	die( $no_access_message );
84 84
 }
85 85
 
86 86
 // If redirect is on, get new feed URL and redirect if setting was changed more than 48 hours ago
87
-$redirect = get_option( 'ss_podcasting_redirect_feed' );
87
+$redirect = get_option ( 'ss_podcasting_redirect_feed' );
88 88
 $new_feed_url = false;
89 89
 if ( $redirect && $redirect == 'on' ) {
90 90
 
91
-	$new_feed_url = get_option( 'ss_podcasting_new_feed_url' );
92
-	$update_date = get_option( 'ss_podcasting_redirect_feed_date' );
91
+	$new_feed_url = get_option ( 'ss_podcasting_new_feed_url' );
92
+	$update_date = get_option ( 'ss_podcasting_redirect_feed_date' );
93 93
 
94 94
 	if ( $new_feed_url && $update_date ) {
95
-		$redirect_date = strtotime( '+2 days' , $update_date );
96
-		$current_date = time();
95
+		$redirect_date = strtotime ( '+2 days', $update_date );
96
+		$current_date = time ();
97 97
 
98 98
 		// Redirect with 301 if it is more than 2 days since redirect was saved
99 99
 		if ( $current_date > $redirect_date ) {
100 100
 			header ( 'HTTP/1.1 301 Moved Permanently' );
101
-			header ( 'Location: ' . $new_feed_url );
101
+			header ( 'Location: '.$new_feed_url );
102 102
 			exit;
103 103
 		}
104 104
 	}
105 105
 }
106 106
 
107 107
 // If this is a series-sepcific feed, then check if we need to redirect
108
-if( $series_id ) {
109
-	$redirect = get_option( 'ss_podcasting_redirect_feed_' . $series_id );
108
+if ( $series_id ) {
109
+	$redirect = get_option ( 'ss_podcasting_redirect_feed_'.$series_id );
110 110
 	$new_feed_url = false;
111 111
 	if ( $redirect && $redirect == 'on' ) {
112
-		$new_feed_url = get_option( 'ss_podcasting_new_feed_url_' . $series_id );
112
+		$new_feed_url = get_option ( 'ss_podcasting_new_feed_url_'.$series_id );
113 113
 		if ( $new_feed_url ) {
114 114
 			header ( 'HTTP/1.1 301 Moved Permanently' );
115
-			header ( 'Location: ' . $new_feed_url );
115
+			header ( 'Location: '.$new_feed_url );
116 116
 			exit;
117 117
 		}
118 118
 	}
119 119
 }
120 120
 
121 121
 // Podcast title
122
-$title = get_option( 'ss_podcasting_data_title', get_bloginfo( 'name' ) );
122
+$title = get_option ( 'ss_podcasting_data_title', get_bloginfo ( 'name' ) );
123 123
 if ( $podcast_series ) {
124
-	$series_title = get_option( 'ss_podcasting_data_title_' . $series_id, '' );
124
+	$series_title = get_option ( 'ss_podcasting_data_title_'.$series_id, '' );
125 125
 	if ( $series_title ) {
126 126
 		$title = $series_title;
127 127
 	}
128 128
 }
129
-$title = apply_filters( 'ssp_feed_title', $title, $series_id );
129
+$title = apply_filters ( 'ssp_feed_title', $title, $series_id );
130 130
 
131 131
 // Podcast description
132
-$description = get_option( 'ss_podcasting_data_description', get_bloginfo( 'description' ) );
132
+$description = get_option ( 'ss_podcasting_data_description', get_bloginfo ( 'description' ) );
133 133
 if ( $podcast_series ) {
134
-	$series_description = get_option( 'ss_podcasting_data_description_' . $series_id, '' );
134
+	$series_description = get_option ( 'ss_podcasting_data_description_'.$series_id, '' );
135 135
 	if ( $series_description ) {
136 136
 		$description = $series_description;
137 137
 	}
138 138
 }
139
-$podcast_description = mb_substr( strip_tags( $description ), 0, 3999 );
140
-$podcast_description = apply_filters( 'ssp_feed_description', $podcast_description, $series_id );
139
+$podcast_description = mb_substr ( strip_tags ( $description ), 0, 3999 );
140
+$podcast_description = apply_filters ( 'ssp_feed_description', $podcast_description, $series_id );
141 141
 
142 142
 // Podcast language
143
-$language = get_option( 'ss_podcasting_data_language', get_bloginfo( 'language' ) );
143
+$language = get_option ( 'ss_podcasting_data_language', get_bloginfo ( 'language' ) );
144 144
 if ( $podcast_series ) {
145
-	$series_language = get_option( 'ss_podcasting_data_language_' . $series_id, '' );
145
+	$series_language = get_option ( 'ss_podcasting_data_language_'.$series_id, '' );
146 146
 	if ( $series_language ) {
147 147
 		$language = $series_language;
148 148
 	}
149 149
 }
150
-$language = apply_filters( 'ssp_feed_language', $language, $series_id );
150
+$language = apply_filters ( 'ssp_feed_language', $language, $series_id );
151 151
 
152 152
 // Podcast copyright string
153
-$copyright = get_option( 'ss_podcasting_data_copyright', '&#xA9; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ) );
153
+$copyright = get_option ( 'ss_podcasting_data_copyright', '&#xA9; '.date ( 'Y' ).' '.get_bloginfo ( 'name' ) );
154 154
 if ( $podcast_series ) {
155
-	$series_copyright = get_option( 'ss_podcasting_data_copyright_' . $series_id, '' );
155
+	$series_copyright = get_option ( 'ss_podcasting_data_copyright_'.$series_id, '' );
156 156
 	if ( $series_copyright ) {
157 157
 		$copyright = $series_copyright;
158 158
 	}
159 159
 }
160
-$copyright = apply_filters( 'ssp_feed_copyright', $copyright, $series_id );
160
+$copyright = apply_filters ( 'ssp_feed_copyright', $copyright, $series_id );
161 161
 
162 162
 // Podcast subtitle
163
-$subtitle = get_option( 'ss_podcasting_data_subtitle', get_bloginfo( 'description' ) );
163
+$subtitle = get_option ( 'ss_podcasting_data_subtitle', get_bloginfo ( 'description' ) );
164 164
 if ( $podcast_series ) {
165
-	$series_subtitle = get_option( 'ss_podcasting_data_subtitle_' . $series_id, '' );
165
+	$series_subtitle = get_option ( 'ss_podcasting_data_subtitle_'.$series_id, '' );
166 166
 	if ( $series_subtitle ) {
167 167
 		$subtitle = $series_subtitle;
168 168
 	}
169 169
 }
170
-$subtitle = apply_filters( 'ssp_feed_subtitle', $subtitle, $series_id );
170
+$subtitle = apply_filters ( 'ssp_feed_subtitle', $subtitle, $series_id );
171 171
 
172 172
 // Podcast author
173
-$author = get_option( 'ss_podcasting_data_author', get_bloginfo( 'name' ) );
173
+$author = get_option ( 'ss_podcasting_data_author', get_bloginfo ( 'name' ) );
174 174
 if ( $podcast_series ) {
175
-	$series_author = get_option( 'ss_podcasting_data_author_' . $series_id, '' );
175
+	$series_author = get_option ( 'ss_podcasting_data_author_'.$series_id, '' );
176 176
 	if ( $series_author ) {
177 177
 		$author = $series_author;
178 178
 	}
179 179
 }
180
-$author = apply_filters( 'ssp_feed_author', $author, $series_id );
180
+$author = apply_filters ( 'ssp_feed_author', $author, $series_id );
181 181
 
182 182
 // Podcast owner name
183
-$owner_name = get_option( 'ss_podcasting_data_owner_name', get_bloginfo( 'name' ) );
183
+$owner_name = get_option ( 'ss_podcasting_data_owner_name', get_bloginfo ( 'name' ) );
184 184
 if ( $podcast_series ) {
185
-	$series_owner_name = get_option( 'ss_podcasting_data_owner_name_' . $series_id, '' );
185
+	$series_owner_name = get_option ( 'ss_podcasting_data_owner_name_'.$series_id, '' );
186 186
 	if ( $series_owner_name ) {
187 187
 		$owner_name = $series_owner_name;
188 188
 	}
189 189
 }
190
-$owner_name = apply_filters( 'ssp_feed_owner_name', $owner_name, $series_id );
190
+$owner_name = apply_filters ( 'ssp_feed_owner_name', $owner_name, $series_id );
191 191
 
192 192
 // Podcast owner email address
193
-$owner_email = get_option( 'ss_podcasting_data_owner_email', get_bloginfo( 'admin_email' ) );
193
+$owner_email = get_option ( 'ss_podcasting_data_owner_email', get_bloginfo ( 'admin_email' ) );
194 194
 if ( $podcast_series ) {
195
-	$series_owner_email = get_option( 'ss_podcasting_data_owner_email_' . $series_id, '' );
195
+	$series_owner_email = get_option ( 'ss_podcasting_data_owner_email_'.$series_id, '' );
196 196
 	if ( $series_owner_email ) {
197 197
 		$owner_email = $series_owner_email;
198 198
 	}
199 199
 }
200
-$owner_email = apply_filters( 'ssp_feed_owner_email', $owner_email, $series_id );
200
+$owner_email = apply_filters ( 'ssp_feed_owner_email', $owner_email, $series_id );
201 201
 
202 202
 // Podcast explicit setting
203
-$explicit_option = get_option( 'ss_podcasting_explicit', '' );
203
+$explicit_option = get_option ( 'ss_podcasting_explicit', '' );
204 204
 if ( $podcast_series ) {
205
-	$series_explicit_option = get_option( 'ss_podcasting_explicit_' . $series_id, '' );
205
+	$series_explicit_option = get_option ( 'ss_podcasting_explicit_'.$series_id, '' );
206 206
 	$explicit_option = $series_explicit_option;
207 207
 }
208
-$explicit_option = apply_filters( 'ssp_feed_explicit', $explicit_option, $series_id );
208
+$explicit_option = apply_filters ( 'ssp_feed_explicit', $explicit_option, $series_id );
209 209
 if ( $explicit_option && 'on' == $explicit_option ) {
210 210
 	$itunes_explicit = 'yes';
211 211
 	$googleplay_explicit = 'Yes';
@@ -215,12 +215,12 @@  discard block
 block discarded – undo
215 215
 }
216 216
 
217 217
 // Podcast complete setting
218
-$complete_option = get_option( 'ss_podcasting_complete', '' );
218
+$complete_option = get_option ( 'ss_podcasting_complete', '' );
219 219
 if ( $podcast_series ) {
220
-	$series_complete_option = get_option( 'ss_podcasting_complete_' . $series_id, '' );
220
+	$series_complete_option = get_option ( 'ss_podcasting_complete_'.$series_id, '' );
221 221
 	$complete_option = $series_complete_option;
222 222
 }
223
-$complete_option = apply_filters( 'ssp_feed_complete', $complete_option, $series_id );
223
+$complete_option = apply_filters ( 'ssp_feed_complete', $complete_option, $series_id );
224 224
 if ( $complete_option && 'on' == $complete_option ) {
225 225
 	$complete = 'yes';
226 226
 } else {
@@ -228,32 +228,32 @@  discard block
 block discarded – undo
228 228
 }
229 229
 
230 230
 // Podcast cover image
231
-$image = get_option( 'ss_podcasting_data_image', '' );
231
+$image = get_option ( 'ss_podcasting_data_image', '' );
232 232
 if ( $podcast_series ) {
233
-	$series_image = get_option( 'ss_podcasting_data_image_' . $series_id, 'no-image' );
233
+	$series_image = get_option ( 'ss_podcasting_data_image_'.$series_id, 'no-image' );
234 234
 	if ( 'no-image' != $series_image ) {
235 235
 		$image = $series_image;
236 236
 	}
237 237
 }
238
-$image = apply_filters( 'ssp_feed_image', $image, $series_id );
238
+$image = apply_filters ( 'ssp_feed_image', $image, $series_id );
239 239
 
240 240
 // Podcast category and subcategory (all levels) - can be filtered with `ssp_feed_category_output`
241
-$category1 = ssp_get_feed_category_output( 1, $series_id );
242
-$category2 = ssp_get_feed_category_output( 2, $series_id );
243
-$category3 = ssp_get_feed_category_output( 3, $series_id );
241
+$category1 = ssp_get_feed_category_output ( 1, $series_id );
242
+$category2 = ssp_get_feed_category_output ( 2, $series_id );
243
+$category3 = ssp_get_feed_category_output ( 3, $series_id );
244 244
 
245 245
 // Get stylehseet URL (filterable to allow custom RSS stylesheets)
246
-$stylehseet_url = apply_filters( 'ssp_rss_stylesheet', $ss_podcasting->template_url . 'feed-stylesheet.xsl' );
246
+$stylehseet_url = apply_filters ( 'ssp_rss_stylesheet', $ss_podcasting->template_url.'feed-stylesheet.xsl' );
247 247
 
248 248
 // Set RSS content type and charset headers
249
-header( 'Content-Type: ' . feed_content_type( 'podcast' ) . '; charset=' . get_option( 'blog_charset' ), true );
249
+header ( 'Content-Type: '.feed_content_type ( 'podcast' ).'; charset='.get_option ( 'blog_charset' ), true );
250 250
 
251 251
 // Use `echo` for first line to prevent any extra characters at start of document
252
-echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?>' . "\n";
252
+echo '<?xml version="1.0" encoding="'.get_option ( 'blog_charset' ).'"?>'."\n";
253 253
 
254 254
 // Include RSS stylesheet
255
-if( $stylehseet_url ) {
256
-	echo '<?xml-stylesheet type="text/xsl" href="' . esc_url( $stylehseet_url ) . '"?>';
255
+if ( $stylehseet_url ) {
256
+	echo '<?xml-stylesheet type="text/xsl" href="'.esc_url ( $stylehseet_url ).'"?>';
257 257
 } ?>
258 258
 
259 259
 <rss version="2.0"
@@ -265,90 +265,90 @@  discard block
 block discarded – undo
265 265
 	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
266 266
 	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
267 267
 	xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"
268
-	<?php do_action( 'rss2_ns' ); ?>
268
+	<?php do_action ( 'rss2_ns' ); ?>
269 269
 >
270 270
 
271 271
 	<channel>
272
-		<title><?php echo esc_html( $title ); ?></title>
273
-		<atom:link href="<?php esc_url( self_link() ); ?>" rel="self" type="application/rss+xml" />
274
-		<link><?php echo esc_url( apply_filters( 'ssp_feed_channel_link_tag', $ss_podcasting->home_url, $podcast_series ) ) ?></link>
275
-		<description><?php echo esc_html( $description ); ?></description>
276
-		<lastBuildDate><?php echo esc_html( mysql2date( 'D, d M Y H:i:s +0000', get_lastpostmodified( 'GMT' ), false ) ); ?></lastBuildDate>
277
-		<language><?php echo esc_html( $language ); ?></language>
278
-		<copyright><?php echo esc_html( $copyright ); ?></copyright>
279
-		<itunes:subtitle><?php echo esc_html( $subtitle ); ?></itunes:subtitle>
280
-		<itunes:author><?php echo esc_html( $author ); ?></itunes:author>
281
-		<googleplay:author><?php echo esc_html( $author ); ?></googleplay:author>
282
-		<googleplay:email><?php echo esc_html( $owner_email ); ?></googleplay:email>
283
-		<itunes:summary><?php echo esc_html( $podcast_description ); ?></itunes:summary>
284
-		<googleplay:description><?php echo esc_html( $podcast_description ); ?></googleplay:description>
272
+		<title><?php echo esc_html ( $title ); ?></title>
273
+		<atom:link href="<?php esc_url ( self_link () ); ?>" rel="self" type="application/rss+xml" />
274
+		<link><?php echo esc_url ( apply_filters ( 'ssp_feed_channel_link_tag', $ss_podcasting->home_url, $podcast_series ) ) ?></link>
275
+		<description><?php echo esc_html ( $description ); ?></description>
276
+		<lastBuildDate><?php echo esc_html ( mysql2date ( 'D, d M Y H:i:s +0000', get_lastpostmodified ( 'GMT' ), false ) ); ?></lastBuildDate>
277
+		<language><?php echo esc_html ( $language ); ?></language>
278
+		<copyright><?php echo esc_html ( $copyright ); ?></copyright>
279
+		<itunes:subtitle><?php echo esc_html ( $subtitle ); ?></itunes:subtitle>
280
+		<itunes:author><?php echo esc_html ( $author ); ?></itunes:author>
281
+		<googleplay:author><?php echo esc_html ( $author ); ?></googleplay:author>
282
+		<googleplay:email><?php echo esc_html ( $owner_email ); ?></googleplay:email>
283
+		<itunes:summary><?php echo esc_html ( $podcast_description ); ?></itunes:summary>
284
+		<googleplay:description><?php echo esc_html ( $podcast_description ); ?></googleplay:description>
285 285
 		<itunes:owner>
286
-			<itunes:name><?php echo esc_html( $owner_name ); ?></itunes:name>
287
-			<itunes:email><?php echo esc_html( $owner_email ); ?></itunes:email>
286
+			<itunes:name><?php echo esc_html ( $owner_name ); ?></itunes:name>
287
+			<itunes:email><?php echo esc_html ( $owner_email ); ?></itunes:email>
288 288
 		</itunes:owner>
289
-		<itunes:explicit><?php echo esc_html( $itunes_explicit ); ?></itunes:explicit>
290
-		<googleplay:explicit><?php echo esc_html( $googleplay_explicit ); ?></googleplay:explicit>
291
-		<?php if( $complete ) { ?><itunes:complete><?php echo esc_html( $complete ); ?></itunes:complete><?php }
289
+		<itunes:explicit><?php echo esc_html ( $itunes_explicit ); ?></itunes:explicit>
290
+		<googleplay:explicit><?php echo esc_html ( $googleplay_explicit ); ?></googleplay:explicit>
291
+		<?php if ( $complete ) { ?><itunes:complete><?php echo esc_html ( $complete ); ?></itunes:complete><?php }
292 292
 if ( $image ) {
293
-		?><itunes:image href="<?php echo esc_url( $image ); ?>"></itunes:image>
294
-		<googleplay:image href="<?php echo esc_url( $image ); ?>"></googleplay:image>
293
+		?><itunes:image href="<?php echo esc_url ( $image ); ?>"></itunes:image>
294
+		<googleplay:image href="<?php echo esc_url ( $image ); ?>"></googleplay:image>
295 295
 		<image>
296
-			<url><?php echo esc_url( $image ); ?></url>
297
-			<title><?php echo esc_html( $title ); ?></title>
298
-			<link><?php echo esc_url( apply_filters( 'ssp_feed_channel_link_tag', $ss_podcasting->home_url, $podcast_series ) ) ?></link>
296
+			<url><?php echo esc_url ( $image ); ?></url>
297
+			<title><?php echo esc_html ( $title ); ?></title>
298
+			<link><?php echo esc_url ( apply_filters ( 'ssp_feed_channel_link_tag', $ss_podcasting->home_url, $podcast_series ) ) ?></link>
299 299
 		</image>
300 300
 <?php }
301
-if ( isset( $category1['category'] ) && $category1['category'] ) { ?>
302
-		<itunes:category text="<?php echo esc_attr( $category1['category'] ); ?>">
303
-<?php if ( isset( $category1['subcategory'] ) && $category1['subcategory'] ) { ?>
304
-			<itunes:category text="<?php echo esc_attr( $category1['subcategory'] ); ?>"></itunes:category>
301
+if ( isset( $category1[ 'category' ] ) && $category1[ 'category' ] ) { ?>
302
+		<itunes:category text="<?php echo esc_attr ( $category1[ 'category' ] ); ?>">
303
+<?php if ( isset( $category1[ 'subcategory' ] ) && $category1[ 'subcategory' ] ) { ?>
304
+			<itunes:category text="<?php echo esc_attr ( $category1[ 'subcategory' ] ); ?>"></itunes:category>
305 305
 <?php } ?>
306 306
 		</itunes:category>
307 307
 <?php } ?>
308
-<?php if ( isset( $category2['category'] ) && $category2['category'] ) { ?>
309
-		<itunes:category text="<?php echo esc_attr( $category2['category'] ); ?>">
310
-<?php if ( isset( $category2['subcategory'] ) && $category2['subcategory'] ) { ?>
311
-			<itunes:category text="<?php echo esc_attr( $category2['subcategory'] ); ?>"></itunes:category>
308
+<?php if ( isset( $category2[ 'category' ] ) && $category2[ 'category' ] ) { ?>
309
+		<itunes:category text="<?php echo esc_attr ( $category2[ 'category' ] ); ?>">
310
+<?php if ( isset( $category2[ 'subcategory' ] ) && $category2[ 'subcategory' ] ) { ?>
311
+			<itunes:category text="<?php echo esc_attr ( $category2[ 'subcategory' ] ); ?>"></itunes:category>
312 312
 <?php } ?>
313 313
 		</itunes:category>
314 314
 <?php } ?>
315
-<?php if ( isset( $category3['category'] ) && $category3['category'] ) { ?>
316
-		<itunes:category text="<?php echo esc_attr( $category3['category'] ); ?>">
317
-<?php if ( isset( $category3['subcategory'] ) && $category3['subcategory'] ) { ?>
318
-			<itunes:category text="<?php echo esc_attr( $category3['subcategory'] ); ?>"></itunes:category>
315
+<?php if ( isset( $category3[ 'category' ] ) && $category3[ 'category' ] ) { ?>
316
+		<itunes:category text="<?php echo esc_attr ( $category3[ 'category' ] ); ?>">
317
+<?php if ( isset( $category3[ 'subcategory' ] ) && $category3[ 'subcategory' ] ) { ?>
318
+			<itunes:category text="<?php echo esc_attr ( $category3[ 'subcategory' ] ); ?>"></itunes:category>
319 319
 <?php } ?>
320 320
 		</itunes:category>
321 321
 	<?php } ?>
322 322
 	<?php if ( $new_feed_url ) { ?>
323
-		<itunes:new-feed-url><?php echo esc_url( $new_feed_url ); ?></itunes:new-feed-url>
323
+		<itunes:new-feed-url><?php echo esc_url ( $new_feed_url ); ?></itunes:new-feed-url>
324 324
 	<?php }
325 325
 
326 326
 		// Prevent WP core from outputting an <image> element
327
-		remove_action( 'rss2_head', 'rss2_site_icon' );
327
+		remove_action ( 'rss2_head', 'rss2_site_icon' );
328 328
 
329 329
 		// Add RSS2 headers
330
-		do_action( 'rss2_head' );
330
+		do_action ( 'rss2_head' );
331 331
 
332 332
 		// Get post IDs of all podcast episodes
333
-		$num_posts = intval( apply_filters( 'ssp_feed_number_of_posts', get_option( 'posts_per_rss', 10 ) ) );
333
+		$num_posts = intval ( apply_filters ( 'ssp_feed_number_of_posts', get_option ( 'posts_per_rss', 10 ) ) );
334 334
 
335
-		$args = ssp_episodes( $num_posts, $podcast_series, true, 'feed' );
335
+		$args = ssp_episodes ( $num_posts, $podcast_series, true, 'feed' );
336 336
 
337
-		$qry = new WP_Query( $args );
337
+		$qry = new WP_Query ( $args );
338 338
 
339
-		if ( $qry->have_posts() ) {
340
-			while ( $qry->have_posts()) {
341
-				$qry->the_post();
339
+		if ( $qry->have_posts () ) {
340
+			while ( $qry->have_posts () ) {
341
+				$qry->the_post ();
342 342
 
343 343
 				// Audio file
344
-				$audio_file = $ss_podcasting->get_enclosure( get_the_ID() );
345
-				if ( get_option( 'permalink_structure' ) ) {
346
-					$enclosure = $ss_podcasting->get_episode_download_link( get_the_ID() );
344
+				$audio_file = $ss_podcasting->get_enclosure ( get_the_ID () );
345
+				if ( get_option ( 'permalink_structure' ) ) {
346
+					$enclosure = $ss_podcasting->get_episode_download_link ( get_the_ID () );
347 347
 				} else {
348 348
 					$enclosure = $audio_file;
349 349
 				}
350 350
 
351
-				$enclosure = apply_filters( 'ssp_feed_item_enclosure', $enclosure, get_the_ID() );
351
+				$enclosure = apply_filters ( 'ssp_feed_item_enclosure', $enclosure, get_the_ID () );
352 352
 
353 353
 				// If there is no enclosure then go no further
354 354
 				if ( ! isset( $enclosure ) || ! $enclosure ) {
@@ -357,46 +357,46 @@  discard block
 block discarded – undo
357 357
 
358 358
 				// Get episode image from post featured image
359 359
 				$episode_image = '';
360
-				$image_id = get_post_thumbnail_id( get_the_ID() );
360
+				$image_id = get_post_thumbnail_id ( get_the_ID () );
361 361
 				if ( $image_id ) {
362
-					$image_att = wp_get_attachment_image_src( $image_id, 'full' );
362
+					$image_att = wp_get_attachment_image_src ( $image_id, 'full' );
363 363
 					if ( $image_att ) {
364
-						$episode_image = $image_att[0];
364
+						$episode_image = $image_att[ 0 ];
365 365
 					}
366 366
 				}
367
-				$episode_image = apply_filters( 'ssp_feed_item_image', $episode_image, get_the_ID() );
367
+				$episode_image = apply_filters ( 'ssp_feed_item_image', $episode_image, get_the_ID () );
368 368
 
369 369
 				// Episode duration (default to 0:00 to ensure there is always a value for this)
370
-				$duration = get_post_meta( get_the_ID(), 'duration', true );
370
+				$duration = get_post_meta ( get_the_ID (), 'duration', true );
371 371
 				if ( ! $duration ) {
372 372
 					$duration = '0:00';
373 373
 				}
374
-				$duration = apply_filters( 'ssp_feed_item_duration', $duration, get_the_ID() );
374
+				$duration = apply_filters ( 'ssp_feed_item_duration', $duration, get_the_ID () );
375 375
 
376 376
 				// File size
377
-				$size = get_post_meta( get_the_ID(), 'filesize_raw', true );
377
+				$size = get_post_meta ( get_the_ID (), 'filesize_raw', true );
378 378
 				if ( ! $size ) {
379 379
 					$size = 1;
380 380
 				}
381
-				$size = apply_filters( 'ssp_feed_item_size', $size, get_the_ID() );
381
+				$size = apply_filters ( 'ssp_feed_item_size', $size, get_the_ID () );
382 382
 
383 383
 				// File MIME type (default to MP3/MP4 to ensure there is always a value for this)
384
-				$mime_type = $ss_podcasting->get_attachment_mimetype( $audio_file );
384
+				$mime_type = $ss_podcasting->get_attachment_mimetype ( $audio_file );
385 385
 				if ( ! $mime_type ) {
386 386
 
387 387
 					// Get the episode type (audio or video) to determine the appropriate default MIME type
388
-					$episode_type = $ss_podcasting->get_episode_type( get_the_ID() );
388
+					$episode_type = $ss_podcasting->get_episode_type ( get_the_ID () );
389 389
 
390
-					switch( $episode_type ) {
390
+					switch ( $episode_type ) {
391 391
 						case 'audio': $mime_type = 'audio/mpeg'; break;
392 392
 						case 'video': $mime_type = 'video/mp4'; break;
393 393
 					}
394 394
 				}
395
-				$mime_type = apply_filters( 'ssp_feed_item_mime_type', $mime_type, get_the_ID() );
395
+				$mime_type = apply_filters ( 'ssp_feed_item_mime_type', $mime_type, get_the_ID () );
396 396
 
397 397
 				// Episode explicit flag
398
-				$ep_explicit = get_post_meta( get_the_ID(), 'explicit', true );
399
-				$ep_explicit = apply_filters( 'ssp_feed_item_explicit', $ep_explicit, get_the_ID() );
398
+				$ep_explicit = get_post_meta ( get_the_ID (), 'explicit', true );
399
+				$ep_explicit = apply_filters ( 'ssp_feed_item_explicit', $ep_explicit, get_the_ID () );
400 400
 				if ( $ep_explicit && $ep_explicit == 'on' ) {
401 401
 					$itunes_explicit_flag = 'yes';
402 402
 					$googleplay_explicit_flag = 'Yes';
@@ -406,8 +406,8 @@  discard block
 block discarded – undo
406 406
 				}
407 407
 
408 408
 				// Episode block flag
409
-				$ep_block = get_post_meta( get_the_ID(), 'block', true );
410
-				$ep_block = apply_filters( 'ssp_feed_item_block', $ep_block, get_the_ID() );
409
+				$ep_block = get_post_meta ( get_the_ID (), 'block', true );
410
+				$ep_block = apply_filters ( 'ssp_feed_item_block', $ep_block, get_the_ID () );
411 411
 				if ( $ep_block && $ep_block == 'on' ) {
412 412
 					$block_flag = 'yes';
413 413
 				} else {
@@ -415,53 +415,53 @@  discard block
 block discarded – undo
415 415
 				}
416 416
 
417 417
 				// Episode author
418
-				$author = esc_html( get_the_author() );
419
-				$author = apply_filters( 'ssp_feed_item_author', $author, get_the_ID() );
418
+				$author = esc_html ( get_the_author () );
419
+				$author = apply_filters ( 'ssp_feed_item_author', $author, get_the_ID () );
420 420
 
421 421
 				// Episode content (with iframes removed)
422
-				$content = get_the_content_feed( 'rss2' );
423
-				$content = preg_replace( '/<\/?iframe(.|\s)*?>/', '', $content );
424
-				$content = apply_filters( 'ssp_feed_item_content', $content, get_the_ID() );
422
+				$content = get_the_content_feed ( 'rss2' );
423
+				$content = preg_replace ( '/<\/?iframe(.|\s)*?>/', '', $content );
424
+				$content = apply_filters ( 'ssp_feed_item_content', $content, get_the_ID () );
425 425
 
426 426
 				// iTunes summary is the full episode content, but must be shorter than 4000 characters
427
-				$itunes_summary = mb_substr( $content, 0, 3999 );
428
-				$itunes_summary = apply_filters( 'ssp_feed_item_itunes_summary', $itunes_summary, get_the_ID() );
429
-				$gp_description = apply_filters( 'ssp_feed_item_gp_description', $itunes_summary, get_the_ID() );
427
+				$itunes_summary = mb_substr ( $content, 0, 3999 );
428
+				$itunes_summary = apply_filters ( 'ssp_feed_item_itunes_summary', $itunes_summary, get_the_ID () );
429
+				$gp_description = apply_filters ( 'ssp_feed_item_gp_description', $itunes_summary, get_the_ID () );
430 430
 
431 431
 				// Episode description
432
-				ob_start();
433
-				the_excerpt_rss();
434
-				$description = ob_get_clean();
435
-				$description = apply_filters( 'ssp_feed_item_description', $description, get_the_ID() );
432
+				ob_start ();
433
+				the_excerpt_rss ();
434
+				$description = ob_get_clean ();
435
+				$description = apply_filters ( 'ssp_feed_item_description', $description, get_the_ID () );
436 436
 
437 437
 				// iTunes subtitle does not allow any HTML and must be shorter than 255 characters
438
-				$itunes_subtitle = strip_tags( strip_shortcodes( $description ) );
439
-				$itunes_subtitle = str_replace( array( '>', '<', '\'', '"', '`', '[andhellip;]', '[&hellip;]', '[&#8230;]' ), array( '', '', '', '', '', '', '', '' ), $itunes_subtitle );
440
-				$itunes_subtitle = mb_substr( $itunes_subtitle, 0, 254 );
441
-				$itunes_subtitle = apply_filters( 'ssp_feed_item_itunes_subtitle', $itunes_subtitle, get_the_ID() );
438
+				$itunes_subtitle = strip_tags ( strip_shortcodes ( $description ) );
439
+				$itunes_subtitle = str_replace ( array( '>', '<', '\'', '"', '`', '[andhellip;]', '[&hellip;]', '[&#8230;]' ), array( '', '', '', '', '', '', '', '' ), $itunes_subtitle );
440
+				$itunes_subtitle = mb_substr ( $itunes_subtitle, 0, 254 );
441
+				$itunes_subtitle = apply_filters ( 'ssp_feed_item_itunes_subtitle', $itunes_subtitle, get_the_ID () );
442 442
 
443 443
 		?>
444 444
 		<item>
445
-			<title><?php esc_html( the_title_rss() ); ?></title>
446
-			<link><?php esc_url( the_permalink_rss() ); ?></link>
447
-			<pubDate><?php echo esc_html( mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ) ); ?></pubDate>
445
+			<title><?php esc_html ( the_title_rss () ); ?></title>
446
+			<link><?php esc_url ( the_permalink_rss () ); ?></link>
447
+			<pubDate><?php echo esc_html ( mysql2date ( 'D, d M Y H:i:s +0000', get_post_time ( 'Y-m-d H:i:s', true ), false ) ); ?></pubDate>
448 448
 			<dc:creator><?php echo $author; ?></dc:creator>
449
-			<guid isPermaLink="false"><?php esc_html( the_guid() ); ?></guid>
449
+			<guid isPermaLink="false"><?php esc_html ( the_guid () ); ?></guid>
450 450
 			<description><![CDATA[<?php echo $description; ?>]]></description>
451 451
 			<itunes:subtitle><![CDATA[<?php echo $itunes_subtitle; ?>]]></itunes:subtitle>
452 452
 			<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
453 453
 			<itunes:summary><![CDATA[<?php echo $itunes_summary; ?>]]></itunes:summary>
454 454
 			<googleplay:description><![CDATA[<?php echo $gp_description; ?>]]></googleplay:description>
455 455
 <?php if ( $episode_image ) { ?>
456
-			<itunes:image href="<?php echo esc_url( $episode_image ); ?>"></itunes:image>
457
-			<googleplay:image href="<?php echo esc_url( $episode_image ); ?>"></googleplay:image>
456
+			<itunes:image href="<?php echo esc_url ( $episode_image ); ?>"></itunes:image>
457
+			<googleplay:image href="<?php echo esc_url ( $episode_image ); ?>"></googleplay:image>
458 458
 <?php } ?>
459
-			<enclosure url="<?php echo esc_url( $enclosure ); ?>" length="<?php echo esc_attr( $size ); ?>" type="<?php echo esc_attr( $mime_type ); ?>"></enclosure>
460
-			<itunes:explicit><?php echo esc_html( $itunes_explicit_flag ); ?></itunes:explicit>
461
-			<googleplay:explicit><?php echo esc_html( $googleplay_explicit_flag ); ?></googleplay:explicit>
462
-			<itunes:block><?php echo esc_html( $block_flag ); ?></itunes:block>
463
-			<googleplay:block><?php echo esc_html( $block_flag ); ?></googleplay:block>
464
-			<itunes:duration><?php echo esc_html( $duration ); ?></itunes:duration>
459
+			<enclosure url="<?php echo esc_url ( $enclosure ); ?>" length="<?php echo esc_attr ( $size ); ?>" type="<?php echo esc_attr ( $mime_type ); ?>"></enclosure>
460
+			<itunes:explicit><?php echo esc_html ( $itunes_explicit_flag ); ?></itunes:explicit>
461
+			<googleplay:explicit><?php echo esc_html ( $googleplay_explicit_flag ); ?></googleplay:explicit>
462
+			<itunes:block><?php echo esc_html ( $block_flag ); ?></itunes:block>
463
+			<googleplay:block><?php echo esc_html ( $block_flag ); ?></googleplay:block>
464
+			<itunes:duration><?php echo esc_html ( $duration ); ?></itunes:duration>
465 465
 			<itunes:author><?php echo $author; ?></itunes:author>
466 466
 		</item>
467 467
 <?php }
Please login to merge, or discard this patch.
includes/class-ssp-settings.php 1 patch
Spacing   +355 added lines, -355 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -31,37 +31,37 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public function __construct( $file ) {
33 33
 		$this->file = $file;
34
-		$this->dir = dirname( $this->file );
35
-		$this->assets_dir = trailingslashit( $this->dir ) . 'assets';
36
-		$this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $this->file ) ) );
37
-		$this->home_url = trailingslashit( home_url() );
34
+		$this->dir = dirname ( $this->file );
35
+		$this->assets_dir = trailingslashit ( $this->dir ).'assets';
36
+		$this->assets_url = esc_url ( trailingslashit ( plugins_url ( '/assets/', $this->file ) ) );
37
+		$this->home_url = trailingslashit ( home_url () );
38 38
 		$this->token = 'podcast';
39 39
 		$this->settings_base = 'ss_podcasting_';
40 40
 
41
-		add_action( 'init', array( $this, 'load_settings' ), 11 );
41
+		add_action ( 'init', array( $this, 'load_settings' ), 11 );
42 42
 
43 43
 		// Register podcast settings
44
-		add_action( 'admin_init' , array( $this, 'register_settings' ) );
44
+		add_action ( 'admin_init', array( $this, 'register_settings' ) );
45 45
 
46 46
 		// Add settings page to menu
47
-		add_action( 'admin_menu', array( $this , 'add_menu_item' ) );
47
+		add_action ( 'admin_menu', array( $this, 'add_menu_item' ) );
48 48
 
49 49
 		// Add settings link to plugins page
50
-		add_filter( 'plugin_action_links_' . plugin_basename( $this->file ), array( $this , 'add_plugin_links' ) );
50
+		add_filter ( 'plugin_action_links_'.plugin_basename ( $this->file ), array( $this, 'add_plugin_links' ) );
51 51
 
52 52
 		// Load scripts for settings page
53
-		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) , 10 );
53
+		add_action ( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10 );
54 54
 
55 55
 		// Mark date on which feed redirection was activated
56
-		add_action( 'update_option', array( $this, 'mark_feed_redirect_date' ) , 10 , 3 );
56
+		add_action ( 'update_option', array( $this, 'mark_feed_redirect_date' ), 10, 3 );
57 57
 
58 58
 		// New caps for editors and above.
59
-		add_action( 'admin_init', array( $this, 'add_caps' ), 1 );
59
+		add_action ( 'admin_init', array( $this, 'add_caps' ), 1 );
60 60
 
61 61
 	}
62 62
 
63 63
 	public function load_settings() {
64
-		$this->settings = $this->settings_fields();
64
+		$this->settings = $this->settings_fields ();
65 65
 	}
66 66
 
67 67
 	/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @return  void
70 70
 	 */
71 71
 	public function add_menu_item() {
72
-		add_submenu_page( 'edit.php?post_type=podcast' , __( 'Podcast Settings', 'seriously-simple-podcasting' ) , __( 'Settings', 'seriously-simple-podcasting' ), 'manage_podcast' , 'podcast_settings' , array( $this , 'settings_page' ) );
72
+		add_submenu_page ( 'edit.php?post_type=podcast', __ ( 'Podcast Settings', 'seriously-simple-podcasting' ), __ ( 'Settings', 'seriously-simple-podcasting' ), 'manage_podcast', 'podcast_settings', array( $this, 'settings_page' ) );
73 73
 	}
74 74
 
75 75
 	/**
@@ -79,19 +79,19 @@  discard block
 block discarded – undo
79 79
 
80 80
 		// Roles you'd like to have administer the podcast settings page.
81 81
 		// Admin and Editor, as default.
82
-		$roles = apply_filters( 'ssp_manage_podcast', array( 'administrator', 'editor' ) );
82
+		$roles = apply_filters ( 'ssp_manage_podcast', array( 'administrator', 'editor' ) );
83 83
 
84 84
 		// Loop through each role and assign capabilities
85
-		foreach( $roles as $the_role ) {
85
+		foreach ( $roles as $the_role ) {
86 86
 
87
-			$role = get_role( $the_role );
87
+			$role = get_role ( $the_role );
88 88
 			$caps = array(
89 89
 				'manage_podcast',
90 90
 			);
91 91
 
92 92
 			// Add the caps.
93 93
 			foreach ( $caps as $cap ) {
94
-				$this->maybe_add_cap( $role, $cap );
94
+				$this->maybe_add_cap ( $role, $cap );
95 95
 			}
96 96
 		}
97 97
 	}
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	public function maybe_add_cap( $role, $cap ) {
107 107
 		// Update the roles, if needed.
108
-		if ( ! $role->has_cap( $cap ) ) {
109
-			$role->add_cap( $cap );
108
+		if ( ! $role->has_cap ( $cap ) ) {
109
+			$role->add_cap ( $cap );
110 110
 		}
111 111
 	}
112 112
 
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
 	 * @return array $links Modified links
117 117
 	 */
118 118
 	public function add_plugin_links( $links ) {
119
-		$settings_link = '<a href="edit.php?post_type=podcast&page=podcast_settings">' . __( 'Settings', 'seriously-simple-podcasting' ) . '</a>';
120
-  		array_push( $links, $settings_link );
119
+		$settings_link = '<a href="edit.php?post_type=podcast&page=podcast_settings">'.__ ( 'Settings', 'seriously-simple-podcasting' ).'</a>';
120
+  		array_push ( $links, $settings_link );
121 121
   		return $links;
122 122
 	}
123 123
 
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function enqueue_scripts() {
129 129
 		global $pagenow;
130
-		if ( in_array( $pagenow, array( 'post-new.php', 'post.php' ) ) || ( isset( $_GET['page'] ) && 'podcast_settings' == $_GET['page'] ) ) {
131
-			wp_enqueue_media();
130
+		if ( in_array ( $pagenow, array( 'post-new.php', 'post.php' ) ) || ( isset( $_GET[ 'page' ] ) && 'podcast_settings' == $_GET[ 'page' ] ) ) {
131
+			wp_enqueue_media ();
132 132
 		}
133 133
 	}
134 134
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 		// Set options for post type selection
145 145
 		foreach ( $wp_post_types as $post_type => $data ) {
146 146
 
147
-			if ( in_array( $post_type, array( 'page', 'attachment', 'revision', 'nav_menu_item', 'wooframework', 'podcast' ) ) ){
147
+			if ( in_array ( $post_type, array( 'page', 'attachment', 'revision', 'nav_menu_item', 'wooframework', 'podcast' ) ) ) {
148 148
 				continue;
149 149
 			}
150 150
 
@@ -153,181 +153,181 @@  discard block
 block discarded – undo
153 153
 
154 154
 		// Set up available category options
155 155
 		$category_options = array(
156
-			'' => __( '-- None --', 'seriously-simple-podcasting' ),
157
-			'Arts' => __( 'Arts', 'seriously-simple-podcasting' ),
158
-			'Business' => __( 'Business', 'seriously-simple-podcasting' ),
159
-			'Comedy' => __( 'Comedy', 'seriously-simple-podcasting' ),
160
-			'Education' => __( 'Education', 'seriously-simple-podcasting' ),
161
-			'Games & Hobbies' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ),
162
-			'Government & Organizations' => __( 'Government & Organizations', 'seriously-simple-podcasting' ),
163
-			'Health' => __( 'Health', 'seriously-simple-podcasting' ),
164
-			'Kids & Family' => __( 'Kids & Family', 'seriously-simple-podcasting' ),
165
-			'Music' => __( 'Music', 'seriously-simple-podcasting' ),
166
-			'News & Politics' => __( 'News & Politics', 'seriously-simple-podcasting' ),
167
-			'Religion & Spirituality' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ),
168
-			'Science & Medicine' => __( 'Science & Medicine', 'seriously-simple-podcasting' ),
169
-			'Society & Culture' => __( 'Society & Culture', 'seriously-simple-podcasting' ),
170
-			'Sports & Recreation' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ),
171
-			'Technology' => __( 'Technology', 'seriously-simple-podcasting' ),
172
-			'TV & Film' => __( 'TV & Film', 'seriously-simple-podcasting' ),
156
+			'' => __ ( '-- None --', 'seriously-simple-podcasting' ),
157
+			'Arts' => __ ( 'Arts', 'seriously-simple-podcasting' ),
158
+			'Business' => __ ( 'Business', 'seriously-simple-podcasting' ),
159
+			'Comedy' => __ ( 'Comedy', 'seriously-simple-podcasting' ),
160
+			'Education' => __ ( 'Education', 'seriously-simple-podcasting' ),
161
+			'Games & Hobbies' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ),
162
+			'Government & Organizations' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ),
163
+			'Health' => __ ( 'Health', 'seriously-simple-podcasting' ),
164
+			'Kids & Family' => __ ( 'Kids & Family', 'seriously-simple-podcasting' ),
165
+			'Music' => __ ( 'Music', 'seriously-simple-podcasting' ),
166
+			'News & Politics' => __ ( 'News & Politics', 'seriously-simple-podcasting' ),
167
+			'Religion & Spirituality' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ),
168
+			'Science & Medicine' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ),
169
+			'Society & Culture' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ),
170
+			'Sports & Recreation' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ),
171
+			'Technology' => __ ( 'Technology', 'seriously-simple-podcasting' ),
172
+			'TV & Film' => __ ( 'TV & Film', 'seriously-simple-podcasting' ),
173 173
 		);
174 174
 
175 175
 		// Set up available sub-category options
176 176
 		$subcategory_options = array(
177 177
 
178
-			'' => __( '-- None --', 'seriously-simple-podcasting' ),
179
-
180
-			'Design' => array( 'label' => __( 'Design', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
181
-			'Fashion & Beauty' => array( 'label' => __( 'Fashion & Beauty', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
182
-			'Food' => array( 'label' => __( 'Food', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
183
-			'Literature' => array( 'label' => __( 'Literature', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
184
-			'Performing Arts' => array( 'label' => __( 'Performing Arts', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
185
-			'Visual Arts' => array( 'label' => __( 'Visual Arts', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
186
-
187
-			'Business News' => array( 'label' => __( 'Business News', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
188
-			'Careers' => array( 'label' => __( 'Careers', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
189
-			'Investing' => array( 'label' => __( 'Investing', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
190
-			'Management & Marketing' => array( 'label' => __( 'Management & Marketing', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
191
-			'Shopping' => array( 'label' => __( 'Shopping', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
192
-
193
-			'Education' => array( 'label' => __( 'Education', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
194
-			'Education Technology' => array( 'label' => __( 'Education Technology', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
195
-			'Higher Education' => array( 'label' => __( 'Higher Education', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
196
-			'K-12' => array( 'label' => __( 'K-12', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
197
-			'Language Courses' => array( 'label' => __( 'Language Courses', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
198
-			'Training' => array( 'label' => __( 'Training', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
199
-
200
-			'Automotive' => array( 'label' => __( 'Automotive', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
201
-			'Aviation' => array( 'label' => __( 'Aviation', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
202
-			'Hobbies' => array( 'label' => __( 'Hobbies', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
203
-			'Other Games' => array( 'label' => __( 'Other Games', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
204
-			'Video Games' => array( 'label' => __( 'Video Games', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
205
-
206
-			'Local' => array( 'label' => __( 'Local', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
207
-			'National' => array( 'label' => __( 'National', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
208
-			'Non-Profit' => array( 'label' => __( 'Non-Profit', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
209
-			'Regional' => array( 'label' => __( 'Regional', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
210
-
211
-			'Alternative Health' => array( 'label' => __( 'Alternative Health', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
212
-			'Fitness & Nutrition' => array( 'label' => __( 'Fitness & Nutrition', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
213
-			'Self-Help' => array( 'label' => __( 'Self-Help', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
214
-			'Sexuality' => array( 'label' => __( 'Sexuality', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
215
-
216
-			'Buddhism' => array( 'label' => __( 'Buddhism', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
217
-			'Christianity' => array( 'label' => __( 'Christianity', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
218
-			'Hinduism' => array( 'label' => __( 'Hinduism', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
219
-			'Islam' => array( 'label' => __( 'Islam', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
220
-			'Judaism' => array( 'label' => __( 'Judaism', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
221
-			'Other' => array( 'label' => __( 'Other', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
222
-			'Spirituality' => array( 'label' => __( 'Spirituality', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
223
-
224
-			'Medicine' => array( 'label' => __( 'Medicine', 'seriously-simple-podcasting' ), 'group' => __( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
225
-			'Natural Sciences' => array( 'label' => __( 'Natural Sciences', 'seriously-simple-podcasting' ), 'group' => __( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
226
-			'Social Sciences' => array( 'label' => __( 'Social Sciences', 'seriously-simple-podcasting' ), 'group' => __( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
227
-
228
-			'History' => array( 'label' => __( 'History', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
229
-			'Personal Journals' => array( 'label' => __( 'Personal Journals', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
230
-			'Philosophy' => array( 'label' => __( 'Philosophy', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
231
-			'Places & Travel' => array( 'label' => __( 'Places & Travel', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
232
-
233
-			'Amateur' => array( 'label' => __( 'Amateur', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
234
-			'College & High School' => array( 'label' => __( 'College & High School', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
235
-			'Outdoor' => array( 'label' => __( 'Outdoor', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
236
-			'Professional' => array( 'label' => __( 'Professional', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
237
-
238
-			'Gadgets' => array( 'label' => __( 'Gadgets', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
239
-			'Tech News' => array( 'label' => __( 'Tech News', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
240
-			'Podcasting' => array( 'label' => __( 'Podcasting', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
241
-			'Software How-To' => array( 'label' => __( 'Software How-To', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
178
+			'' => __ ( '-- None --', 'seriously-simple-podcasting' ),
179
+
180
+			'Design' => array( 'label' => __ ( 'Design', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
181
+			'Fashion & Beauty' => array( 'label' => __ ( 'Fashion & Beauty', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
182
+			'Food' => array( 'label' => __ ( 'Food', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
183
+			'Literature' => array( 'label' => __ ( 'Literature', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
184
+			'Performing Arts' => array( 'label' => __ ( 'Performing Arts', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
185
+			'Visual Arts' => array( 'label' => __ ( 'Visual Arts', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
186
+
187
+			'Business News' => array( 'label' => __ ( 'Business News', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
188
+			'Careers' => array( 'label' => __ ( 'Careers', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
189
+			'Investing' => array( 'label' => __ ( 'Investing', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
190
+			'Management & Marketing' => array( 'label' => __ ( 'Management & Marketing', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
191
+			'Shopping' => array( 'label' => __ ( 'Shopping', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
192
+
193
+			'Education' => array( 'label' => __ ( 'Education', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
194
+			'Education Technology' => array( 'label' => __ ( 'Education Technology', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
195
+			'Higher Education' => array( 'label' => __ ( 'Higher Education', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
196
+			'K-12' => array( 'label' => __ ( 'K-12', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
197
+			'Language Courses' => array( 'label' => __ ( 'Language Courses', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
198
+			'Training' => array( 'label' => __ ( 'Training', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
199
+
200
+			'Automotive' => array( 'label' => __ ( 'Automotive', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
201
+			'Aviation' => array( 'label' => __ ( 'Aviation', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
202
+			'Hobbies' => array( 'label' => __ ( 'Hobbies', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
203
+			'Other Games' => array( 'label' => __ ( 'Other Games', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
204
+			'Video Games' => array( 'label' => __ ( 'Video Games', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
205
+
206
+			'Local' => array( 'label' => __ ( 'Local', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
207
+			'National' => array( 'label' => __ ( 'National', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
208
+			'Non-Profit' => array( 'label' => __ ( 'Non-Profit', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
209
+			'Regional' => array( 'label' => __ ( 'Regional', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
210
+
211
+			'Alternative Health' => array( 'label' => __ ( 'Alternative Health', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
212
+			'Fitness & Nutrition' => array( 'label' => __ ( 'Fitness & Nutrition', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
213
+			'Self-Help' => array( 'label' => __ ( 'Self-Help', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
214
+			'Sexuality' => array( 'label' => __ ( 'Sexuality', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
215
+
216
+			'Buddhism' => array( 'label' => __ ( 'Buddhism', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
217
+			'Christianity' => array( 'label' => __ ( 'Christianity', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
218
+			'Hinduism' => array( 'label' => __ ( 'Hinduism', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
219
+			'Islam' => array( 'label' => __ ( 'Islam', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
220
+			'Judaism' => array( 'label' => __ ( 'Judaism', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
221
+			'Other' => array( 'label' => __ ( 'Other', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
222
+			'Spirituality' => array( 'label' => __ ( 'Spirituality', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
223
+
224
+			'Medicine' => array( 'label' => __ ( 'Medicine', 'seriously-simple-podcasting' ), 'group' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
225
+			'Natural Sciences' => array( 'label' => __ ( 'Natural Sciences', 'seriously-simple-podcasting' ), 'group' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
226
+			'Social Sciences' => array( 'label' => __ ( 'Social Sciences', 'seriously-simple-podcasting' ), 'group' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
227
+
228
+			'History' => array( 'label' => __ ( 'History', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
229
+			'Personal Journals' => array( 'label' => __ ( 'Personal Journals', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
230
+			'Philosophy' => array( 'label' => __ ( 'Philosophy', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
231
+			'Places & Travel' => array( 'label' => __ ( 'Places & Travel', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
232
+
233
+			'Amateur' => array( 'label' => __ ( 'Amateur', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
234
+			'College & High School' => array( 'label' => __ ( 'College & High School', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
235
+			'Outdoor' => array( 'label' => __ ( 'Outdoor', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
236
+			'Professional' => array( 'label' => __ ( 'Professional', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
237
+
238
+			'Gadgets' => array( 'label' => __ ( 'Gadgets', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
239
+			'Tech News' => array( 'label' => __ ( 'Tech News', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
240
+			'Podcasting' => array( 'label' => __ ( 'Podcasting', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
241
+			'Software How-To' => array( 'label' => __ ( 'Software How-To', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
242 242
 
243 243
 		);
244 244
 
245 245
 		$settings = array();
246 246
 
247
-		$settings['general'] = array(
248
-			'title'					=> __( 'General', 'seriously-simple-podcasting' ),
249
-			'description'			=> __( '', 'seriously-simple-podcasting' ),
247
+		$settings[ 'general' ] = array(
248
+			'title'					=> __ ( 'General', 'seriously-simple-podcasting' ),
249
+			'description'			=> __ ( '', 'seriously-simple-podcasting' ),
250 250
 			'fields'				=> array(
251 251
 				array(
252 252
 					'id' 			=> 'use_post_types',
253
-					'label'			=> __( 'Podcast post types', 'seriously-simple-podcasting' ),
254
-					'description'	=> __( 'Use this setting to enable podcast functions on any post type - this will add all podcast posts from the specified types to your podcast feed.', 'seriously-simple-podcasting' ),
253
+					'label'			=> __ ( 'Podcast post types', 'seriously-simple-podcasting' ),
254
+					'description'	=> __ ( 'Use this setting to enable podcast functions on any post type - this will add all podcast posts from the specified types to your podcast feed.', 'seriously-simple-podcasting' ),
255 255
 					'type'			=> 'checkbox_multi',
256 256
 					'options'		=> $post_type_options,
257 257
 					'default'		=> array(),
258 258
 				),
259 259
 				array(
260 260
 					'id' 			=> 'include_in_main_query',
261
-					'label'			=> __( 'Include podcast in main blog', 'seriously-simple-podcasting' ),
262
-					'description'	=> __( 'This setting may behave differently in each theme, so test it carefully after activation - it will add the \'podcast\' post type to your site\'s main query so that your podcast episodes appear on your home page along with your blog posts.', 'seriously-simple-podcasting' ),
261
+					'label'			=> __ ( 'Include podcast in main blog', 'seriously-simple-podcasting' ),
262
+					'description'	=> __ ( 'This setting may behave differently in each theme, so test it carefully after activation - it will add the \'podcast\' post type to your site\'s main query so that your podcast episodes appear on your home page along with your blog posts.', 'seriously-simple-podcasting' ),
263 263
 					'type'			=> 'checkbox',
264 264
 					'default'		=> '',
265 265
 				),
266 266
 				array(
267 267
 					'id' 			=> 'player_locations',
268
-					'label'			=> __( 'Media player locations', 'seriously-simple-podcasting' ),
269
-					'description'	=> __( 'Select where to show the podcast media player along with the episode data (download link, duration and file size)', 'seriously-simple-podcasting' ),
268
+					'label'			=> __ ( 'Media player locations', 'seriously-simple-podcasting' ),
269
+					'description'	=> __ ( 'Select where to show the podcast media player along with the episode data (download link, duration and file size)', 'seriously-simple-podcasting' ),
270 270
 					'type'			=> 'checkbox_multi',
271
-					'options'		=> array( 'content' => __( 'Full content', 'seriously-simple-podcasting' ), 'excerpt' => __( 'Excerpt', 'seriously-simple-podcasting' ),  'excerpt_embed' => __( 'oEmbed Excerpt', 'seriously-simple-podcasting' ) ),
271
+					'options'		=> array( 'content' => __ ( 'Full content', 'seriously-simple-podcasting' ), 'excerpt' => __ ( 'Excerpt', 'seriously-simple-podcasting' ), 'excerpt_embed' => __ ( 'oEmbed Excerpt', 'seriously-simple-podcasting' ) ),
272 272
 					'default'		=> array(),
273 273
 				),
274 274
 				array(
275 275
 					'id' 			=> 'player_content_location',
276
-					'label'			=> __( 'Media player position', 'seriously-simple-podcasting' ),
277
-					'description'	=> __( 'Select whether to display the media player above or below the full post content.', 'seriously-simple-podcasting' ),
276
+					'label'			=> __ ( 'Media player position', 'seriously-simple-podcasting' ),
277
+					'description'	=> __ ( 'Select whether to display the media player above or below the full post content.', 'seriously-simple-podcasting' ),
278 278
 					'type'			=> 'radio',
279
-					'options'		=> array( 'above' => __( 'Above content', 'seriously-simple-podcasting' ), 'below' => __( 'Below content', 'seriously-simple-podcasting' ) ),
279
+					'options'		=> array( 'above' => __ ( 'Above content', 'seriously-simple-podcasting' ), 'below' => __ ( 'Below content', 'seriously-simple-podcasting' ) ),
280 280
 					'default'		=> 'above',
281 281
 				),
282 282
 				array(
283 283
 					'id' 			=> 'player_content_visibility',
284
-					'label'			=> __( 'Media player visibility', 'seriously-simple-podcasting' ),
285
-					'description'	=> __( 'Select whether to display the media player to everybody or only logged in users.', 'seriously-simple-podcasting' ),
284
+					'label'			=> __ ( 'Media player visibility', 'seriously-simple-podcasting' ),
285
+					'description'	=> __ ( 'Select whether to display the media player to everybody or only logged in users.', 'seriously-simple-podcasting' ),
286 286
 					'type'			=> 'radio',
287
-					'options'		=> array( 'all' => __( 'Everybody', 'seriously-simple-podcasting' ), 'membersonly' => __( 'Only logged in users', 'seriously-simple-podcasting' ) ),
287
+					'options'		=> array( 'all' => __ ( 'Everybody', 'seriously-simple-podcasting' ), 'membersonly' => __ ( 'Only logged in users', 'seriously-simple-podcasting' ) ),
288 288
 					'default'		=> 'all',
289 289
 				),
290 290
 			),
291 291
 		);
292 292
 
293
-		$settings['feed-details'] = array(
294
-			'title'					=> __( 'Feed details', 'seriously-simple-podcasting' ),
295
-			'description'			=> sprintf( __( 'This data will be used in the feed for your podcast so your listeners will know more about it before they subscribe.%1$sAll of these fields are optional, but it is recommended that you fill in as many of them as possible. Blank fields will use the assigned defaults in the feed.%2$s', 'seriously-simple-podcasting' ), '<br/><em>', '</em>' ),
293
+		$settings[ 'feed-details' ] = array(
294
+			'title'					=> __ ( 'Feed details', 'seriously-simple-podcasting' ),
295
+			'description'			=> sprintf ( __ ( 'This data will be used in the feed for your podcast so your listeners will know more about it before they subscribe.%1$sAll of these fields are optional, but it is recommended that you fill in as many of them as possible. Blank fields will use the assigned defaults in the feed.%2$s', 'seriously-simple-podcasting' ), '<br/><em>', '</em>' ),
296 296
 			'fields'				=> array(
297 297
 				array(
298 298
 					'id' 			=> 'data_title',
299
-					'label'			=> __( 'Title' , 'seriously-simple-podcasting' ),
300
-					'description'	=> __( 'Your podcast title.', 'seriously-simple-podcasting' ),
299
+					'label'			=> __ ( 'Title', 'seriously-simple-podcasting' ),
300
+					'description'	=> __ ( 'Your podcast title.', 'seriously-simple-podcasting' ),
301 301
 					'type'			=> 'text',
302
-					'default'		=> get_bloginfo( 'name' ),
303
-					'placeholder'	=> get_bloginfo( 'name' ),
302
+					'default'		=> get_bloginfo ( 'name' ),
303
+					'placeholder'	=> get_bloginfo ( 'name' ),
304 304
 					'class'			=> 'large-text',
305 305
 					'callback'		=> 'wp_strip_all_tags',
306 306
 				),
307 307
 				array(
308 308
 					'id' 			=> 'data_subtitle',
309
-					'label'			=> __( 'Subtitle' , 'seriously-simple-podcasting' ),
310
-					'description'	=> __( 'Your podcast subtitle.', 'seriously-simple-podcasting' ),
309
+					'label'			=> __ ( 'Subtitle', 'seriously-simple-podcasting' ),
310
+					'description'	=> __ ( 'Your podcast subtitle.', 'seriously-simple-podcasting' ),
311 311
 					'type'			=> 'text',
312
-					'default'		=> get_bloginfo( 'description' ),
313
-					'placeholder'	=> get_bloginfo( 'description' ),
312
+					'default'		=> get_bloginfo ( 'description' ),
313
+					'placeholder'	=> get_bloginfo ( 'description' ),
314 314
 					'class'			=> 'large-text',
315 315
 					'callback'		=> 'wp_strip_all_tags',
316 316
 				),
317 317
 				array(
318 318
 					'id' 			=> 'data_author',
319
-					'label'			=> __( 'Author' , 'seriously-simple-podcasting' ),
320
-					'description'	=> __( 'Your podcast author.', 'seriously-simple-podcasting' ),
319
+					'label'			=> __ ( 'Author', 'seriously-simple-podcasting' ),
320
+					'description'	=> __ ( 'Your podcast author.', 'seriously-simple-podcasting' ),
321 321
 					'type'			=> 'text',
322
-					'default'		=> get_bloginfo( 'name' ),
323
-					'placeholder'	=> get_bloginfo( 'name' ),
322
+					'default'		=> get_bloginfo ( 'name' ),
323
+					'placeholder'	=> get_bloginfo ( 'name' ),
324 324
 					'class'			=> 'large-text',
325 325
 					'callback'		=> 'wp_strip_all_tags',
326 326
 				),
327 327
 				array(
328 328
 					'id' 			=> 'data_category',
329
-					'label'			=> __( 'Primary Category' , 'seriously-simple-podcasting' ),
330
-					'description'	=> __( 'Your podcast\'s primary category.', 'seriously-simple-podcasting' ),
329
+					'label'			=> __ ( 'Primary Category', 'seriously-simple-podcasting' ),
330
+					'description'	=> __ ( 'Your podcast\'s primary category.', 'seriously-simple-podcasting' ),
331 331
 					'type'			=> 'select',
332 332
 					'options'		=> $category_options,
333 333
 					'default'		=> '',
@@ -335,8 +335,8 @@  discard block
 block discarded – undo
335 335
 				),
336 336
 				array(
337 337
 					'id' 			=> 'data_subcategory',
338
-					'label'			=> __( 'Primary Sub-Category' , 'seriously-simple-podcasting' ),
339
-					'description'	=> __( 'Your podcast\'s primary sub-category (if available) - must be a sub-category of the primary category selected above.', 'seriously-simple-podcasting' ),
338
+					'label'			=> __ ( 'Primary Sub-Category', 'seriously-simple-podcasting' ),
339
+					'description'	=> __ ( 'Your podcast\'s primary sub-category (if available) - must be a sub-category of the primary category selected above.', 'seriously-simple-podcasting' ),
340 340
 					'type'			=> 'select',
341 341
 					'options'		=> $subcategory_options,
342 342
 					'default'		=> '',
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
 				),
345 345
 				array(
346 346
 					'id' 			=> 'data_category2',
347
-					'label'			=> __( 'Secondary Category' , 'seriously-simple-podcasting' ),
348
-					'description'	=> __( 'Your podcast\'s secondary category.', 'seriously-simple-podcasting' ),
347
+					'label'			=> __ ( 'Secondary Category', 'seriously-simple-podcasting' ),
348
+					'description'	=> __ ( 'Your podcast\'s secondary category.', 'seriously-simple-podcasting' ),
349 349
 					'type'			=> 'select',
350 350
 					'options'		=> $category_options,
351 351
 					'default'		=> '',
@@ -353,8 +353,8 @@  discard block
 block discarded – undo
353 353
 				),
354 354
 				array(
355 355
 					'id' 			=> 'data_subcategory2',
356
-					'label'			=> __( 'Secondary Sub-Category' , 'seriously-simple-podcasting' ),
357
-					'description'	=> __( 'Your podcast\'s secondary sub-category (if available) - must be a sub-category of the secondary category selected above.', 'seriously-simple-podcasting' ),
356
+					'label'			=> __ ( 'Secondary Sub-Category', 'seriously-simple-podcasting' ),
357
+					'description'	=> __ ( 'Your podcast\'s secondary sub-category (if available) - must be a sub-category of the secondary category selected above.', 'seriously-simple-podcasting' ),
358 358
 					'type'			=> 'select',
359 359
 					'options'		=> $subcategory_options,
360 360
 					'default'		=> '',
@@ -362,8 +362,8 @@  discard block
 block discarded – undo
362 362
 				),
363 363
 				array(
364 364
 					'id' 			=> 'data_category3',
365
-					'label'			=> __( 'Tertiary Category' , 'seriously-simple-podcasting' ),
366
-					'description'	=> __( 'Your podcast\'s tertiary category.', 'seriously-simple-podcasting' ),
365
+					'label'			=> __ ( 'Tertiary Category', 'seriously-simple-podcasting' ),
366
+					'description'	=> __ ( 'Your podcast\'s tertiary category.', 'seriously-simple-podcasting' ),
367 367
 					'type'			=> 'select',
368 368
 					'options'		=> $category_options,
369 369
 					'default'		=> '',
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
 				),
372 372
 				array(
373 373
 					'id' 			=> 'data_subcategory3',
374
-					'label'			=> __( 'Tertiary Sub-Category' , 'seriously-simple-podcasting' ),
375
-					'description'	=> __( 'Your podcast\'s tertiary sub-category (if available) - must be a sub-category of the tertiary category selected above.', 'seriously-simple-podcasting' ),
374
+					'label'			=> __ ( 'Tertiary Sub-Category', 'seriously-simple-podcasting' ),
375
+					'description'	=> __ ( 'Your podcast\'s tertiary sub-category (if available) - must be a sub-category of the tertiary category selected above.', 'seriously-simple-podcasting' ),
376 376
 					'type'			=> 'select',
377 377
 					'options'		=> $subcategory_options,
378 378
 					'default'		=> '',
@@ -380,18 +380,18 @@  discard block
 block discarded – undo
380 380
 				),
381 381
 				array(
382 382
 					'id' 			=> 'data_description',
383
-					'label'			=> __( 'Description/Summary' , 'seriously-simple-podcasting' ),
384
-					'description'	=> __( 'A description/summary of your podcast - no HTML allowed.', 'seriously-simple-podcasting' ),
383
+					'label'			=> __ ( 'Description/Summary', 'seriously-simple-podcasting' ),
384
+					'description'	=> __ ( 'A description/summary of your podcast - no HTML allowed.', 'seriously-simple-podcasting' ),
385 385
 					'type'			=> 'textarea',
386
-					'default'		=> get_bloginfo( 'description' ),
387
-					'placeholder'	=> get_bloginfo( 'description' ),
386
+					'default'		=> get_bloginfo ( 'description' ),
387
+					'placeholder'	=> get_bloginfo ( 'description' ),
388 388
 					'callback'		=> 'wp_strip_all_tags',
389 389
 					'class'			=> 'large-text',
390 390
 				),
391 391
 				array(
392 392
 					'id' 			=> 'data_image',
393
-					'label'			=> __( 'Cover Image' , 'seriously-simple-podcasting' ),
394
-					'description'	=> __( 'Your podcast cover image - must have a minimum size of 1400x1400 px.', 'seriously-simple-podcasting' ),
393
+					'label'			=> __ ( 'Cover Image', 'seriously-simple-podcasting' ),
394
+					'description'	=> __ ( 'Your podcast cover image - must have a minimum size of 1400x1400 px.', 'seriously-simple-podcasting' ),
395 395
 					'type'			=> 'image',
396 396
 					'default'		=> '',
397 397
 					'placeholder'	=> '',
@@ -399,182 +399,182 @@  discard block
 block discarded – undo
399 399
 				),
400 400
 				array(
401 401
 					'id' 			=> 'data_owner_name',
402
-					'label'			=> __( 'Owner name' , 'seriously-simple-podcasting' ),
403
-					'description'	=> __( 'Podcast owner\'s name.', 'seriously-simple-podcasting' ),
402
+					'label'			=> __ ( 'Owner name', 'seriously-simple-podcasting' ),
403
+					'description'	=> __ ( 'Podcast owner\'s name.', 'seriously-simple-podcasting' ),
404 404
 					'type'			=> 'text',
405
-					'default'		=> get_bloginfo( 'name' ),
406
-					'placeholder'	=> get_bloginfo( 'name' ),
405
+					'default'		=> get_bloginfo ( 'name' ),
406
+					'placeholder'	=> get_bloginfo ( 'name' ),
407 407
 					'class'			=> 'large-text',
408 408
 					'callback'		=> 'wp_strip_all_tags',
409 409
 				),
410 410
 				array(
411 411
 					'id' 			=> 'data_owner_email',
412
-					'label'			=> __( 'Owner email address' , 'seriously-simple-podcasting' ),
413
-					'description'	=> __( 'Podcast owner\'s email address.', 'seriously-simple-podcasting' ),
412
+					'label'			=> __ ( 'Owner email address', 'seriously-simple-podcasting' ),
413
+					'description'	=> __ ( 'Podcast owner\'s email address.', 'seriously-simple-podcasting' ),
414 414
 					'type'			=> 'text',
415
-					'default'		=> get_bloginfo( 'admin_email' ),
416
-					'placeholder'	=> get_bloginfo( 'admin_email' ),
415
+					'default'		=> get_bloginfo ( 'admin_email' ),
416
+					'placeholder'	=> get_bloginfo ( 'admin_email' ),
417 417
 					'class'			=> 'large-text',
418 418
 					'callback'		=> 'wp_strip_all_tags',
419 419
 				),
420 420
 				array(
421 421
 					'id' 			=> 'data_language',
422
-					'label'			=> __( 'Language' , 'seriously-simple-podcasting' ),
423
-					'description'	=> sprintf( __( 'Your podcast\'s language in %1$sISO-639-1 format%2$s.', 'seriously-simple-podcasting' ), '<a href="' . esc_url( 'http://www.loc.gov/standards/iso639-2/php/code_list.php' ) . '" target="' . wp_strip_all_tags( '_blank' ) . '">', '</a>' ),
422
+					'label'			=> __ ( 'Language', 'seriously-simple-podcasting' ),
423
+					'description'	=> sprintf ( __ ( 'Your podcast\'s language in %1$sISO-639-1 format%2$s.', 'seriously-simple-podcasting' ), '<a href="'.esc_url ( 'http://www.loc.gov/standards/iso639-2/php/code_list.php' ).'" target="'.wp_strip_all_tags ( '_blank' ).'">', '</a>' ),
424 424
 					'type'			=> 'text',
425
-					'default'		=> get_bloginfo( 'language' ),
426
-					'placeholder'	=> get_bloginfo( 'language' ),
425
+					'default'		=> get_bloginfo ( 'language' ),
426
+					'placeholder'	=> get_bloginfo ( 'language' ),
427 427
 					'class'			=> 'all-options',
428 428
 					'callback'		=> 'wp_strip_all_tags',
429 429
 				),
430 430
 				array(
431 431
 					'id' 			=> 'data_copyright',
432
-					'label'			=> __( 'Copyright' , 'seriously-simple-podcasting' ),
433
-					'description'	=> __( 'Copyright line for your podcast.', 'seriously-simple-podcasting' ),
432
+					'label'			=> __ ( 'Copyright', 'seriously-simple-podcasting' ),
433
+					'description'	=> __ ( 'Copyright line for your podcast.', 'seriously-simple-podcasting' ),
434 434
 					'type'			=> 'text',
435
-					'default'		=> '&#xA9; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ),
436
-					'placeholder'	=> '&#xA9; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ),
435
+					'default'		=> '&#xA9; '.date ( 'Y' ).' '.get_bloginfo ( 'name' ),
436
+					'placeholder'	=> '&#xA9; '.date ( 'Y' ).' '.get_bloginfo ( 'name' ),
437 437
 					'class'			=> 'large-text',
438 438
 					'callback'		=> 'wp_strip_all_tags',
439 439
 				),
440 440
 				array(
441 441
 					'id' 			=> 'explicit',
442
-					'label'			=> __( 'Explicit', 'seriously-simple-podcasting' ),
443
-					'description'	=> __( 'Mark if your podcast is explicit or not.', 'seriously-simple-podcasting' ),
442
+					'label'			=> __ ( 'Explicit', 'seriously-simple-podcasting' ),
443
+					'description'	=> __ ( 'Mark if your podcast is explicit or not.', 'seriously-simple-podcasting' ),
444 444
 					'type'			=> 'checkbox',
445 445
 					'default'		=> '',
446 446
 					'callback'		=> 'wp_strip_all_tags',
447 447
 				),
448 448
 				array(
449 449
 					'id' 			=> 'complete',
450
-					'label'			=> __( 'Complete', 'seriously-simple-podcasting' ),
451
-					'description'	=> __( 'Mark if this podcast is complete or not. Only do this if no more episodes are going to be added to this feed.', 'seriously-simple-podcasting' ),
450
+					'label'			=> __ ( 'Complete', 'seriously-simple-podcasting' ),
451
+					'description'	=> __ ( 'Mark if this podcast is complete or not. Only do this if no more episodes are going to be added to this feed.', 'seriously-simple-podcasting' ),
452 452
 					'type'			=> 'checkbox',
453 453
 					'default'		=> '',
454 454
 					'callback'		=> 'wp_strip_all_tags',
455 455
 				),
456 456
 				array(
457 457
 					'id' 			=> 'redirect_feed',
458
-					'label'			=> __( 'Redirect this feed to new URL', 'seriously-simple-podcasting' ),
459
-					'description'	=> sprintf( __( 'Redirect your feed to a new URL (specified below).', 'seriously-simple-podcasting' ) , '<br/>' ),
458
+					'label'			=> __ ( 'Redirect this feed to new URL', 'seriously-simple-podcasting' ),
459
+					'description'	=> sprintf ( __ ( 'Redirect your feed to a new URL (specified below).', 'seriously-simple-podcasting' ), '<br/>' ),
460 460
 					'type'			=> 'checkbox',
461 461
 					'default'		=> '',
462 462
 					'callback'		=> 'wp_strip_all_tags',
463 463
 				),
464 464
 				array(
465 465
 					'id' 			=> 'new_feed_url',
466
-					'label'			=> __( 'New podcast feed URL', 'seriously-simple-podcasting' ),
467
-					'description'	=> __( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
466
+					'label'			=> __ ( 'New podcast feed URL', 'seriously-simple-podcasting' ),
467
+					'description'	=> __ ( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
468 468
 					'type'			=> 'text',
469 469
 					'default'		=> '',
470
-					'placeholder'	=> __( 'New feed URL', 'seriously-simple-podcasting' ),
470
+					'placeholder'	=> __ ( 'New feed URL', 'seriously-simple-podcasting' ),
471 471
 					'callback'		=> 'esc_url_raw',
472 472
 					'class'			=> 'regular-text',
473 473
 				),
474 474
 			)
475 475
 		);
476 476
 
477
-		$settings['security'] = array(
478
-			'title'					=> __( 'Security', 'seriously-simple-podcasting' ),
479
-			'description'			=> __( 'Change these settings to ensure that your podcast feed remains private. This will block feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
477
+		$settings[ 'security' ] = array(
478
+			'title'					=> __ ( 'Security', 'seriously-simple-podcasting' ),
479
+			'description'			=> __ ( 'Change these settings to ensure that your podcast feed remains private. This will block feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
480 480
 			'fields'				=> array(
481 481
 				array(
482 482
 					'id' 			=> 'protect',
483
-					'label'			=> __( 'Password protect your podcast feed', 'seriously-simple-podcasting' ),
484
-					'description'	=> __( 'Mark if you would like to password protect your podcast feed - you can set the username and password below. This will block all feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
483
+					'label'			=> __ ( 'Password protect your podcast feed', 'seriously-simple-podcasting' ),
484
+					'description'	=> __ ( 'Mark if you would like to password protect your podcast feed - you can set the username and password below. This will block all feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
485 485
 					'type'			=> 'checkbox',
486 486
 					'default'		=> '',
487 487
 					'callback'		=> 'wp_strip_all_tags',
488 488
 				),
489 489
 				array(
490 490
 					'id' 			=> 'protection_username',
491
-					'label'			=> __( 'Username' , 'seriously-simple-podcasting' ),
492
-					'description'	=> __( 'Username for your podcast feed.', 'seriously-simple-podcasting' ),
491
+					'label'			=> __ ( 'Username', 'seriously-simple-podcasting' ),
492
+					'description'	=> __ ( 'Username for your podcast feed.', 'seriously-simple-podcasting' ),
493 493
 					'type'			=> 'text',
494 494
 					'default'		=> '',
495
-					'placeholder'	=> __( 'Feed username', 'seriously-simple-podcasting' ),
495
+					'placeholder'	=> __ ( 'Feed username', 'seriously-simple-podcasting' ),
496 496
 					'class'			=> 'regular-text',
497 497
 					'callback'		=> 'wp_strip_all_tags',
498 498
 				),
499 499
 				array(
500 500
 					'id' 			=> 'protection_password',
501
-					'label'			=> __( 'Password' , 'seriously-simple-podcasting' ),
502
-					'description'	=> __( 'Password for your podcast feed. Once saved, the password is encoded and secured so it will not be visible on this page again.', 'seriously-simple-podcasting' ),
501
+					'label'			=> __ ( 'Password', 'seriously-simple-podcasting' ),
502
+					'description'	=> __ ( 'Password for your podcast feed. Once saved, the password is encoded and secured so it will not be visible on this page again.', 'seriously-simple-podcasting' ),
503 503
 					'type'			=> 'text_secret',
504 504
 					'default'		=> '',
505
-					'placeholder'	=> __( 'Feed password', 'seriously-simple-podcasting' ),
505
+					'placeholder'	=> __ ( 'Feed password', 'seriously-simple-podcasting' ),
506 506
 					'callback'		=> array( $this, 'encode_password' ),
507 507
 					'class'			=> 'regular-text',
508 508
 				),
509 509
 				array(
510 510
 					'id' 			=> 'protection_no_access_message',
511
-					'label'			=> __( 'No access message' , 'seriously-simple-podcasting' ),
512
-					'description'	=> __( 'This message will be displayed to people who are not allowed access to your podcast feed. Limited HTML allowed.', 'seriously-simple-podcasting' ),
511
+					'label'			=> __ ( 'No access message', 'seriously-simple-podcasting' ),
512
+					'description'	=> __ ( 'This message will be displayed to people who are not allowed access to your podcast feed. Limited HTML allowed.', 'seriously-simple-podcasting' ),
513 513
 					'type'			=> 'textarea',
514
-					'default'		=> __( 'You are not permitted to view this podcast feed.', 'seriously-simple-podcasting' ),
515
-					'placeholder'	=> __( 'Message displayed to users who do not have access to the podcast feed', 'seriously-simple-podcasting' ),
514
+					'default'		=> __ ( 'You are not permitted to view this podcast feed.', 'seriously-simple-podcasting' ),
515
+					'placeholder'	=> __ ( 'Message displayed to users who do not have access to the podcast feed', 'seriously-simple-podcasting' ),
516 516
 					'callback'		=> array( $this, 'validate_message' ),
517 517
 					'class'			=> 'large-text',
518 518
 				),
519 519
 			)
520 520
 		);
521 521
 
522
-		$settings['redirection'] = array(
523
-			'title'					=> __( 'Redirection', 'seriously-simple-podcasting' ),
524
-			'description'			=> __( 'Use these settings to safely move your podcast to a different location. Only do this once your new podcast is setup and active.', 'seriously-simple-podcasting' ),
522
+		$settings[ 'redirection' ] = array(
523
+			'title'					=> __ ( 'Redirection', 'seriously-simple-podcasting' ),
524
+			'description'			=> __ ( 'Use these settings to safely move your podcast to a different location. Only do this once your new podcast is setup and active.', 'seriously-simple-podcasting' ),
525 525
 			'fields'				=> array(
526 526
 				array(
527 527
 					'id' 			=> 'redirect_feed',
528
-					'label'			=> __( 'Redirect podcast feed to new URL', 'seriously-simple-podcasting' ),
529
-					'description'	=> sprintf( __( 'Redirect your feed to a new URL (specified below).%1$sThis will inform all podcasting services that your podcast has moved and 48 hours after you have saved this option it will permanently redirect your feed to the new URL.', 'seriously-simple-podcasting' ) , '<br/>' ),
528
+					'label'			=> __ ( 'Redirect podcast feed to new URL', 'seriously-simple-podcasting' ),
529
+					'description'	=> sprintf ( __ ( 'Redirect your feed to a new URL (specified below).%1$sThis will inform all podcasting services that your podcast has moved and 48 hours after you have saved this option it will permanently redirect your feed to the new URL.', 'seriously-simple-podcasting' ), '<br/>' ),
530 530
 					'type'			=> 'checkbox',
531 531
 					'default'		=> '',
532 532
 					'callback'		=> 'wp_strip_all_tags',
533 533
 				),
534 534
 				array(
535 535
 					'id' 			=> 'new_feed_url',
536
-					'label'			=> __( 'New podcast feed URL', 'seriously-simple-podcasting' ),
537
-					'description'	=> __( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
536
+					'label'			=> __ ( 'New podcast feed URL', 'seriously-simple-podcasting' ),
537
+					'description'	=> __ ( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
538 538
 					'type'			=> 'text',
539 539
 					'default'		=> '',
540
-					'placeholder'	=> __( 'New feed URL', 'seriously-simple-podcasting' ),
540
+					'placeholder'	=> __ ( 'New feed URL', 'seriously-simple-podcasting' ),
541 541
 					'callback'		=> 'esc_url_raw',
542 542
 					'class'			=> 'regular-text',
543 543
 				),
544 544
 			)
545 545
 		);
546 546
 
547
-		$settings['publishing'] = array(
548
-			'title'					=> __( 'Publishing' , 'seriously-simple-podcasting' ),
549
-			'description'			=> __( 'Use these URLs to share and publish your podcast feed. These URLs will work with any podcasting service (including iTunes).' , 'seriously-simple-podcasting' ),
547
+		$settings[ 'publishing' ] = array(
548
+			'title'					=> __ ( 'Publishing', 'seriously-simple-podcasting' ),
549
+			'description'			=> __ ( 'Use these URLs to share and publish your podcast feed. These URLs will work with any podcasting service (including iTunes).', 'seriously-simple-podcasting' ),
550 550
 			'fields'				=> array(
551 551
 				array(
552 552
 					'id' 			=> 'feed_url',
553
-					'label'			=> __( 'External feed URL', 'seriously-simple-podcasting' ),
554
-					'description'	=> __( 'If you are syndicating your podcast using a third-party service (like Feedburner) you can insert the URL here, otherwise this must be left blank.' , 'seriously-simple-podcasting' ),
553
+					'label'			=> __ ( 'External feed URL', 'seriously-simple-podcasting' ),
554
+					'description'	=> __ ( 'If you are syndicating your podcast using a third-party service (like Feedburner) you can insert the URL here, otherwise this must be left blank.', 'seriously-simple-podcasting' ),
555 555
 					'type'			=> 'text',
556 556
 					'default'		=> '',
557
-					'placeholder'	=> __( 'External feed URL', 'seriously-simple-podcasting' ),
557
+					'placeholder'	=> __ ( 'External feed URL', 'seriously-simple-podcasting' ),
558 558
 					'callback'		=> 'esc_url_raw',
559 559
 					'class'			=> 'regular-text',
560 560
 				),
561 561
 				array(
562 562
 					'id' 			=> 'feed_link',
563
-					'label'			=> __( 'Complete feed', 'seriously-simple-podcasting' ),
563
+					'label'			=> __ ( 'Complete feed', 'seriously-simple-podcasting' ),
564 564
 					'description'	=> '',
565 565
 					'type'			=> 'feed_link',
566 566
 					'callback'		=> 'esc_url_raw',
567 567
 				),
568 568
 				array(
569 569
 					'id' 			=> 'feed_link_series',
570
-					'label'			=> __( 'Feed for a specific series', 'seriously-simple-podcasting' ),
570
+					'label'			=> __ ( 'Feed for a specific series', 'seriously-simple-podcasting' ),
571 571
 					'description'	=> '',
572 572
 					'type'			=> 'feed_link_series',
573 573
 					'callback'		=> 'esc_url_raw',
574 574
 				),
575 575
 				array(
576 576
 					'id' 			=> 'podcast_url',
577
-					'label'			=> __( 'Podcast page', 'seriously-simple-podcasting' ),
577
+					'label'			=> __ ( 'Podcast page', 'seriously-simple-podcasting' ),
578 578
 					'description'	=> '',
579 579
 					'type'			=> 'podcast_url',
580 580
 					'callback'		=> 'esc_url_raw',
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 			)
583 583
 		);
584 584
 
585
-		$settings = apply_filters( 'ssp_settings_fields', $settings );
585
+		$settings = apply_filters ( 'ssp_settings_fields', $settings );
586 586
 
587 587
 		return $settings;
588 588
 	}
@@ -592,15 +592,15 @@  discard block
 block discarded – undo
592 592
 	 * @return void
593 593
 	 */
594 594
 	public function register_settings() {
595
-		if ( is_array( $this->settings ) ) {
595
+		if ( is_array ( $this->settings ) ) {
596 596
 
597 597
 			// Check posted/selected tab
598 598
 			$current_section = 'general';
599
-			if ( isset( $_POST['tab'] ) && $_POST['tab'] ) {
600
-				$current_section = $_POST['tab'];
599
+			if ( isset( $_POST[ 'tab' ] ) && $_POST[ 'tab' ] ) {
600
+				$current_section = $_POST[ 'tab' ];
601 601
 			} else {
602
-				if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {
603
-					$current_section = $_GET['tab'];
602
+				if ( isset( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] ) {
603
+					$current_section = $_GET[ 'tab' ];
604 604
 				}
605 605
 			}
606 606
 
@@ -615,81 +615,81 @@  discard block
 block discarded – undo
615 615
 				$series_id = 0;
616 616
 				if ( 'feed-details' == $section ) {
617 617
 
618
-					if ( isset( $_REQUEST['feed-series'] ) && $_REQUEST['feed-series'] && 'default' != $_REQUEST['feed-series'] ) {
618
+					if ( isset( $_REQUEST[ 'feed-series' ] ) && $_REQUEST[ 'feed-series' ] && 'default' != $_REQUEST[ 'feed-series' ] ) {
619 619
 
620 620
 						// Get selected series
621
-						$series = get_term_by( 'slug', esc_attr( $_REQUEST['feed-series'] ), 'series' );
621
+						$series = get_term_by ( 'slug', esc_attr ( $_REQUEST[ 'feed-series' ] ), 'series' );
622 622
 
623 623
 						// Store series ID for later use
624 624
 						$series_id = $series->term_id;
625 625
 
626 626
 						// Append series name to section title
627 627
 						if ( $series ) {
628
-							$title_tail = ': ' . $series->name;
628
+							$title_tail = ': '.$series->name;
629 629
 						}
630 630
 					}
631 631
 				}
632 632
 
633
-				$section_title = $data['title'] . $title_tail;
633
+				$section_title = $data[ 'title' ].$title_tail;
634 634
 
635 635
 				// Add section to page
636
-				add_settings_section( $section, $section_title, array( $this, 'settings_section' ), 'ss_podcasting' );
636
+				add_settings_section ( $section, $section_title, array( $this, 'settings_section' ), 'ss_podcasting' );
637 637
 
638
-				foreach ( $data['fields'] as $field ) {
638
+				foreach ( $data[ 'fields' ] as $field ) {
639 639
 
640 640
 					// Validation callback for field
641 641
 					$validation = '';
642
-					if ( isset( $field['callback'] ) ) {
643
-						$validation = $field['callback'];
642
+					if ( isset( $field[ 'callback' ] ) ) {
643
+						$validation = $field[ 'callback' ];
644 644
 					}
645 645
 
646 646
 					// Get field option name
647
-					$option_name = $this->settings_base . $field['id'];
647
+					$option_name = $this->settings_base.$field[ 'id' ];
648 648
 
649 649
 					// Append series ID if selected
650 650
 					if ( $series_id ) {
651
-						$option_name .= '_' . $series_id;
651
+						$option_name .= '_'.$series_id;
652 652
 					}
653 653
 
654 654
 					// Register setting
655
-					register_setting( 'ss_podcasting', $option_name, $validation );
655
+					register_setting ( 'ss_podcasting', $option_name, $validation );
656 656
 
657 657
 					// Add field to page
658
-					add_settings_field( $field['id'], $field['label'], array( $this, 'display_field' ), 'ss_podcasting', $section, array( 'field' => $field, 'prefix' => $this->settings_base, 'feed-series' => $series_id ) );
658
+					add_settings_field ( $field[ 'id' ], $field[ 'label' ], array( $this, 'display_field' ), 'ss_podcasting', $section, array( 'field' => $field, 'prefix' => $this->settings_base, 'feed-series' => $series_id ) );
659 659
 				}
660 660
 			}
661 661
 		}
662 662
 	}
663 663
 
664 664
 	public function settings_section( $section ) {
665
-		$html = '<p>' . $this->settings[ $section['id'] ]['description'] . '</p>' . "\n";
665
+		$html = '<p>'.$this->settings[ $section[ 'id' ] ][ 'description' ].'</p>'."\n";
666 666
 
667
-		if( 'feed-details' == $section['id'] ) {
667
+		if ( 'feed-details' == $section[ 'id' ] ) {
668 668
 
669 669
 			$feed_series = 'default';
670
-			if( isset( $_GET['feed-series'] ) ) {
671
-				$feed_series = esc_attr( $_GET['feed-series'] );
670
+			if ( isset( $_GET[ 'feed-series' ] ) ) {
671
+				$feed_series = esc_attr ( $_GET[ 'feed-series' ] );
672 672
 			}
673 673
 
674
-			$permalink_structure = get_option( 'permalink_structure' );
674
+			$permalink_structure = get_option ( 'permalink_structure' );
675 675
 
676 676
 			if ( $permalink_structure ) {
677
-				$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
678
-				$feed_url = $this->home_url . 'feed/' . $feed_slug;
677
+				$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
678
+				$feed_url = $this->home_url.'feed/'.$feed_slug;
679 679
 			} else {
680
-				$feed_url = $this->home_url . '?feed=' . $this->token;
680
+				$feed_url = $this->home_url.'?feed='.$this->token;
681 681
 			}
682 682
 
683
-			if( $feed_series && $feed_series != 'default' ) {
683
+			if ( $feed_series && $feed_series != 'default' ) {
684 684
 				if ( $permalink_structure ) {
685
-					$feed_url .= '/' . $feed_series;
685
+					$feed_url .= '/'.$feed_series;
686 686
 				} else {
687
-					$feed_url .= '&podcast_series=' . $feed_series;
687
+					$feed_url .= '&podcast_series='.$feed_series;
688 688
 				}
689 689
 			}
690 690
 
691
-			if( $feed_url ) {
692
-				$html .= '<p><a class="view-feed-link" href="' . esc_url( $feed_url ) . '" target="_blank"><span class="dashicons dashicons-rss"></span>' . __( 'View feed', 'seriously-simple-podcasting' ) . '</a></p>' . "\n";
691
+			if ( $feed_url ) {
692
+				$html .= '<p><a class="view-feed-link" href="'.esc_url ( $feed_url ).'" target="_blank"><span class="dashicons dashicons-rss"></span>'.__ ( 'View feed', 'seriously-simple-podcasting' ).'</a></p>'."\n";
693 693
 			}
694 694
 
695 695
 		}
@@ -704,116 +704,116 @@  discard block
 block discarded – undo
704 704
 	 */
705 705
 	public function display_field( $args ) {
706 706
 
707
-		$field = $args['field'];
707
+		$field = $args[ 'field' ];
708 708
 
709 709
 		$html = '';
710 710
 
711 711
 		// Get option name
712
-		$option_name = $this->settings_base . $field['id'];
712
+		$option_name = $this->settings_base.$field[ 'id' ];
713 713
 		$default_option_name = $option_name;
714 714
 
715 715
 		// Get field default
716 716
 		$default = '';
717
-		if ( isset( $field['default'] ) ) {
718
-			$default = $field['default'];
717
+		if ( isset( $field[ 'default' ] ) ) {
718
+			$default = $field[ 'default' ];
719 719
 		}
720 720
 
721 721
 		// Get option value
722
-		$data = get_option( $option_name, $default );
722
+		$data = get_option ( $option_name, $default );
723 723
 
724 724
 		// Get specific series data if applicable
725
-		if ( isset( $args['feed-series'] ) && $args['feed-series'] ) {
725
+		if ( isset( $args[ 'feed-series' ] ) && $args[ 'feed-series' ] ) {
726 726
 
727 727
 			$option_default = '';
728 728
 
729 729
 			// Set placeholder to default feed option with specified default fallback
730 730
 			if ( $data ) {
731
-				$field['placeholder'] = $data;
731
+				$field[ 'placeholder' ] = $data;
732 732
 
733
-				if ( in_array( $field['type'], array( 'checkbox', 'select', 'image' ) ) ) {
733
+				if ( in_array ( $field[ 'type' ], array( 'checkbox', 'select', 'image' ) ) ) {
734 734
 					$option_default = $data;
735 735
 				}
736 736
 			}
737 737
 
738 738
 			// Append series ID to option name
739
-			$option_name .= '_' . $args['feed-series'];
739
+			$option_name .= '_'.$args[ 'feed-series' ];
740 740
 
741 741
 			// Get series-sepcific option
742
-			$data = get_option( $option_name, $option_default );
742
+			$data = get_option ( $option_name, $option_default );
743 743
 
744 744
 		}
745 745
 
746 746
 		// Get field class if supplied
747 747
 		$class = '';
748
-		if ( isset( $field['class'] ) ) {
749
-			$class = $field['class'];
748
+		if ( isset( $field[ 'class' ] ) ) {
749
+			$class = $field[ 'class' ];
750 750
 		}
751 751
 
752 752
 		// Get parent class if supplied
753 753
 		$parent_class = '';
754
-		if ( isset( $field['parent_class'] ) ) {
755
-			$parent_class = $field['parent_class'];
754
+		if ( isset( $field[ 'parent_class' ] ) ) {
755
+			$parent_class = $field[ 'parent_class' ];
756 756
 		}
757 757
 
758
-		switch( $field['type'] ) {
758
+		switch ( $field[ 'type' ] ) {
759 759
 			case 'text':
760 760
 			case 'password':
761 761
 			case 'number':
762
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="' . $field['type'] . '" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $field['placeholder'] ) . '" value="' . esc_attr( $data ) . '" class="' . $class . '"/>' . "\n";
762
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="'.$field[ 'type' ].'" name="'.esc_attr ( $option_name ).'" placeholder="'.esc_attr ( $field[ 'placeholder' ] ).'" value="'.esc_attr ( $data ).'" class="'.$class.'"/>'."\n";
763 763
 			break;
764 764
 
765 765
 			case 'text_secret':
766
-				$placeholder = $field['placeholder'];
766
+				$placeholder = $field[ 'placeholder' ];
767 767
 				if ( $data ) {
768
-					$placeholder = __( 'Password stored securely', 'seriously-simple-podcasting' );
768
+					$placeholder = __ ( 'Password stored securely', 'seriously-simple-podcasting' );
769 769
 				}
770
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="text" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $placeholder ) . '" value="" class="' . $class . '"/>' . "\n";
770
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="text" name="'.esc_attr ( $option_name ).'" placeholder="'.esc_attr ( $placeholder ).'" value="" class="'.$class.'"/>'."\n";
771 771
 			break;
772 772
 
773 773
 			case 'textarea':
774
-				$html .= '<textarea id="' . esc_attr( $field['id'] ) . '" rows="5" cols="50" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $field['placeholder'] ) . '" class="' . $class . '">' . $data . '</textarea><br/>'. "\n";
774
+				$html .= '<textarea id="'.esc_attr ( $field[ 'id' ] ).'" rows="5" cols="50" name="'.esc_attr ( $option_name ).'" placeholder="'.esc_attr ( $field[ 'placeholder' ] ).'" class="'.$class.'">'.$data.'</textarea><br/>'."\n";
775 775
 			break;
776 776
 
777 777
 			case 'checkbox':
778 778
 				$checked = '';
779
-				if ( $data && 'on' == $data ){
779
+				if ( $data && 'on' == $data ) {
780 780
 					$checked = 'checked="checked"';
781 781
 				}
782
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="' . $field['type'] . '" name="' . esc_attr( $option_name ) . '" ' . $checked . ' class="' . $class . '"/>' . "\n";
782
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="'.$field[ 'type' ].'" name="'.esc_attr ( $option_name ).'" '.$checked.' class="'.$class.'"/>'."\n";
783 783
 			break;
784 784
 
785 785
 			case 'checkbox_multi':
786
-				foreach ( $field['options'] as $k => $v ) {
786
+				foreach ( $field[ 'options' ] as $k => $v ) {
787 787
 					$checked = false;
788
-					if ( in_array( $k, (array) $data ) ) {
788
+					if ( in_array ( $k, (array) $data ) ) {
789 789
 						$checked = true;
790 790
 					}
791
-					$html .= '<label for="' . esc_attr( $field['id'] . '_' . $k ) . '"><input type="checkbox" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $option_name ) . '[]" value="' . esc_attr( $k ) . '" id="' . esc_attr( $field['id'] . '_' . $k ) . '" class="' . $class . '" /> ' . $v . '</label><br/>';
791
+					$html .= '<label for="'.esc_attr ( $field[ 'id' ].'_'.$k ).'"><input type="checkbox" '.checked ( $checked, true, false ).' name="'.esc_attr ( $option_name ).'[]" value="'.esc_attr ( $k ).'" id="'.esc_attr ( $field[ 'id' ].'_'.$k ).'" class="'.$class.'" /> '.$v.'</label><br/>';
792 792
 				}
793 793
 			break;
794 794
 
795 795
 			case 'radio':
796
-				foreach ( $field['options'] as $k => $v ) {
796
+				foreach ( $field[ 'options' ] as $k => $v ) {
797 797
 					$checked = false;
798 798
 					if ( $k == $data ) {
799 799
 						$checked = true;
800 800
 					}
801
-					$html .= '<label for="' . esc_attr( $field['id'] . '_' . $k ) . '"><input type="radio" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $option_name ) . '" value="' . esc_attr( $k ) . '" id="' . esc_attr( $field['id'] . '_' . $k ) . '" class="' . $class . '" /> ' . $v . '</label><br/>';
801
+					$html .= '<label for="'.esc_attr ( $field[ 'id' ].'_'.$k ).'"><input type="radio" '.checked ( $checked, true, false ).' name="'.esc_attr ( $option_name ).'" value="'.esc_attr ( $k ).'" id="'.esc_attr ( $field[ 'id' ].'_'.$k ).'" class="'.$class.'" /> '.$v.'</label><br/>';
802 802
 				}
803 803
 			break;
804 804
 
805 805
 			case 'select':
806 806
 
807
-				$html .= '<select name="' . esc_attr( $option_name ) . '" id="' . esc_attr( $field['id'] ) . '" class="' . $class . '">';
807
+				$html .= '<select name="'.esc_attr ( $option_name ).'" id="'.esc_attr ( $field[ 'id' ] ).'" class="'.$class.'">';
808 808
 				$prev_group = '';
809
-				foreach ( $field['options'] as $k => $v ) {
809
+				foreach ( $field[ 'options' ] as $k => $v ) {
810 810
 
811 811
 					$group = '';
812
-					if ( is_array( $v ) ) {
813
-						if ( isset( $v['group'] ) ) {
814
-							$group = $v['group'];
812
+					if ( is_array ( $v ) ) {
813
+						if ( isset( $v[ 'group' ] ) ) {
814
+							$group = $v[ 'group' ];
815 815
 						}
816
-						$v = $v['label'];
816
+						$v = $v[ 'label' ];
817 817
 					}
818 818
 
819 819
 					if ( $prev_group && $group != $prev_group ) {
@@ -826,10 +826,10 @@  discard block
 block discarded – undo
826 826
 					}
827 827
 
828 828
 					if ( $group && $group != $prev_group ) {
829
-						$html .= '<optgroup label="' . esc_attr( $group ) . '">';
829
+						$html .= '<optgroup label="'.esc_attr ( $group ).'">';
830 830
 					}
831 831
 
832
-					$html .= '<option ' . selected( $selected, true, false ) . ' value="' . esc_attr( $k ) . '">' . esc_html( $v ) . '</option>';
832
+					$html .= '<option '.selected ( $selected, true, false ).' value="'.esc_attr ( $k ).'">'.esc_html ( $v ).'</option>';
833 833
 
834 834
 					$prev_group = $group;
835 835
 				}
@@ -837,65 +837,65 @@  discard block
 block discarded – undo
837 837
 			break;
838 838
 
839 839
 			case 'image':
840
-				$html .= '<img id="' . esc_attr( $default_option_name ) . '_preview" src="' . esc_attr( $data ) . '" style="max-width:400px;height:auto;" /><br/>' . "\n";
841
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '_button" type="button" class="button" value="'. __( 'Upload new image' , 'seriously-simple-podcasting' ) . '" />' . "\n";
842
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '_delete" type="button" class="button" value="'. __( 'Remove image' , 'seriously-simple-podcasting' ) . '" />' . "\n";
843
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '" type="hidden" name="' . esc_attr( $option_name ) . '" value="' . esc_attr( $data ) . '"/><br/>' . "\n";
840
+				$html .= '<img id="'.esc_attr ( $default_option_name ).'_preview" src="'.esc_attr ( $data ).'" style="max-width:400px;height:auto;" /><br/>'."\n";
841
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'_button" type="button" class="button" value="'.__ ( 'Upload new image', 'seriously-simple-podcasting' ).'" />'."\n";
842
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'_delete" type="button" class="button" value="'.__ ( 'Remove image', 'seriously-simple-podcasting' ).'" />'."\n";
843
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'" type="hidden" name="'.esc_attr ( $option_name ).'" value="'.esc_attr ( $data ).'"/><br/>'."\n";
844 844
 			break;
845 845
 
846 846
 			case 'feed_link':
847 847
 
848 848
 				// Set feed URL based on site's permalink structure
849
-				if ( get_option( 'permalink_structure' ) ) {
850
-					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
851
-					$url = $this->home_url . 'feed/' . $feed_slug;
849
+				if ( get_option ( 'permalink_structure' ) ) {
850
+					$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
851
+					$url = $this->home_url.'feed/'.$feed_slug;
852 852
 				} else {
853
-					$url = $this->home_url . '?feed=' . $this->token;
853
+					$url = $this->home_url.'?feed='.$this->token;
854 854
 				}
855 855
 
856
-				$html .= '<a href="' . esc_url( $url ) . '" target="_blank">' . $url . '</a>';
856
+				$html .= '<a href="'.esc_url ( $url ).'" target="_blank">'.$url.'</a>';
857 857
 			break;
858 858
 
859 859
 			case 'feed_link_series':
860 860
 
861 861
 				// Set feed URL based on site's permalink structure
862
-				if ( get_option( 'permalink_structure' ) ) {
863
-					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
864
-					$url = $this->home_url . 'feed/' . $feed_slug . '/series-slug';
862
+				if ( get_option ( 'permalink_structure' ) ) {
863
+					$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
864
+					$url = $this->home_url.'feed/'.$feed_slug.'/series-slug';
865 865
 				} else {
866
-					$url = $this->home_url . '?feed=' . $this->token . '&podcast_series=series-slug';
866
+					$url = $this->home_url.'?feed='.$this->token.'&podcast_series=series-slug';
867 867
 				}
868 868
 
869
-				$html .= esc_url( $url ) . "\n";
869
+				$html .= esc_url ( $url )."\n";
870 870
 			break;
871 871
 
872 872
 			case 'podcast_url';
873 873
 
874
-				$slug = apply_filters( 'ssp_archive_slug', __( 'podcast' , 'seriously-simple-podcasting' ) );
875
-				$podcast_url = $this->home_url . $slug;
874
+				$slug = apply_filters ( 'ssp_archive_slug', __ ( 'podcast', 'seriously-simple-podcasting' ) );
875
+				$podcast_url = $this->home_url.$slug;
876 876
 
877
-				$html .= '<a href="' . esc_url( $podcast_url ) . '" target="_blank">' . $podcast_url . '</a>';
877
+				$html .= '<a href="'.esc_url ( $podcast_url ).'" target="_blank">'.$podcast_url.'</a>';
878 878
 			break;
879 879
 
880 880
 		}
881 881
 
882
-		if ( ! in_array( $field['type'], array( 'feed_link', 'feed_link_series', 'podcast_url' ) ) ) {
883
-			switch( $field['type'] ) {
882
+		if ( ! in_array ( $field[ 'type' ], array( 'feed_link', 'feed_link_series', 'podcast_url' ) ) ) {
883
+			switch ( $field[ 'type' ] ) {
884 884
 
885 885
 				case 'checkbox_multi':
886 886
 				case 'radio':
887 887
 				case 'select_multi':
888
-					$html .= '<br/><span class="description">' . esc_attr( $field['description'] ) . '</span>';
888
+					$html .= '<br/><span class="description">'.esc_attr ( $field[ 'description' ] ).'</span>';
889 889
 				break;
890 890
 
891 891
 				default:
892
-					$html .= '<label for="' . esc_attr( $field['id'] ) . '"><span class="description">' . wp_kses_post( $field['description'] ) . '</span></label>' . "\n";
892
+					$html .= '<label for="'.esc_attr ( $field[ 'id' ] ).'"><span class="description">'.wp_kses_post ( $field[ 'description' ] ).'</span></label>'."\n";
893 893
 				break;
894 894
 			}
895 895
 		}
896 896
 
897
-		if( $parent_class ) {
898
-			$html = '<div class="' . $parent_class . '">' . $html . '</div>';
897
+		if ( $parent_class ) {
898
+			$html = '<div class="'.$parent_class.'">'.$html.'</div>';
899 899
 		}
900 900
 
901 901
 		echo $html;
@@ -907,8 +907,8 @@  discard block
 block discarded – undo
907 907
 	 * @return string       Validated string
908 908
 	 */
909 909
 	public function validate_slug( $slug ) {
910
-		if ( $slug && strlen( $slug ) > 0 && $slug != '' ) {
911
-			$slug = urlencode( strtolower( str_replace( ' ' , '-' , $slug ) ) );
910
+		if ( $slug && strlen ( $slug ) > 0 && $slug != '' ) {
911
+			$slug = urlencode ( strtolower ( str_replace ( ' ', '-', $slug ) ) );
912 912
 		}
913 913
 		return $slug;
914 914
 	}
@@ -920,10 +920,10 @@  discard block
 block discarded – undo
920 920
 	 */
921 921
 	public function encode_password( $password ) {
922 922
 
923
-		if ( $password && strlen( $password ) > 0 && $password != '' ) {
924
-			$password = md5( $password );
923
+		if ( $password && strlen ( $password ) > 0 && $password != '' ) {
924
+			$password = md5 ( $password );
925 925
 		} else {
926
-			$option = get_option( 'ss_podcasting_protection_password' );
926
+			$option = get_option ( 'ss_podcasting_protection_password' );
927 927
 			$password = $option;
928 928
 		}
929 929
 
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 			    'p' => array()
952 952
 			);
953 953
 
954
-			$message = wp_kses( $message, $allowed );
954
+			$message = wp_kses ( $message, $allowed );
955 955
 		}
956 956
 
957 957
 		return $message;
@@ -968,8 +968,8 @@  discard block
 block discarded – undo
968 968
 
969 969
 		if ( $option == 'ss_podcasting_redirect_feed' ) {
970 970
 			if ( ( $new_value != $old_value ) && $new_value == 'on' ) {
971
-				$date = time();
972
-				update_option( 'ss_podcasting_redirect_feed_date', $date );
971
+				$date = time ();
972
+				update_option ( 'ss_podcasting_redirect_feed_date', $date );
973 973
 			}
974 974
 		}
975 975
 
@@ -982,64 +982,64 @@  discard block
 block discarded – undo
982 982
 	public function settings_page() {
983 983
 
984 984
 		// Build page HTML
985
-		$html = '<div class="wrap" id="podcast_settings">' . "\n";
986
-			$html .= '<h1>' . __( 'Podcast Settings' , 'seriously-simple-podcasting' ) . '</h1>' . "\n";
985
+		$html = '<div class="wrap" id="podcast_settings">'."\n";
986
+			$html .= '<h1>'.__ ( 'Podcast Settings', 'seriously-simple-podcasting' ).'</h1>'."\n";
987 987
 
988 988
 			$tab = 'general';
989
-			if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {
990
-				$tab = $_GET['tab'];
989
+			if ( isset( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] ) {
990
+				$tab = $_GET[ 'tab' ];
991 991
 			}
992 992
 
993 993
 			// Show page tabs
994
-			if ( is_array( $this->settings ) && 1 < count( $this->settings ) ) {
994
+			if ( is_array ( $this->settings ) && 1 < count ( $this->settings ) ) {
995 995
 
996
-				$html .= '<h2 class="nav-tab-wrapper">' . "\n";
996
+				$html .= '<h2 class="nav-tab-wrapper">'."\n";
997 997
 
998 998
 				$c = 0;
999 999
 				foreach ( $this->settings as $section => $data ) {
1000 1000
 
1001 1001
 					// Set tab class
1002 1002
 					$class = 'nav-tab';
1003
-					if ( ! isset( $_GET['tab'] ) ) {
1003
+					if ( ! isset( $_GET[ 'tab' ] ) ) {
1004 1004
 						if ( 0 == $c ) {
1005 1005
 							$class .= ' nav-tab-active';
1006 1006
 						}
1007 1007
 					} else {
1008
-						if ( isset( $_GET['tab'] ) && $section == $_GET['tab'] ) {
1008
+						if ( isset( $_GET[ 'tab' ] ) && $section == $_GET[ 'tab' ] ) {
1009 1009
 							$class .= ' nav-tab-active';
1010 1010
 						}
1011 1011
 					}
1012 1012
 
1013 1013
 					// Set tab link
1014
-					$tab_link = add_query_arg( array( 'tab' => $section ) );
1015
-					if ( isset( $_GET['settings-updated'] ) ) {
1016
-						$tab_link = remove_query_arg( 'settings-updated', $tab_link );
1014
+					$tab_link = add_query_arg ( array( 'tab' => $section ) );
1015
+					if ( isset( $_GET[ 'settings-updated' ] ) ) {
1016
+						$tab_link = remove_query_arg ( 'settings-updated', $tab_link );
1017 1017
 					}
1018 1018
 
1019
-					if ( isset( $_GET['feed-series'] ) ) {
1020
-						$tab_link = remove_query_arg( 'feed-series', $tab_link );
1019
+					if ( isset( $_GET[ 'feed-series' ] ) ) {
1020
+						$tab_link = remove_query_arg ( 'feed-series', $tab_link );
1021 1021
 					}
1022 1022
 
1023 1023
 					// Output tab
1024
-					$html .= '<a href="' . esc_url( $tab_link ) . '" class="' . esc_attr( $class ) . '">' . esc_html( $data['title'] ) . '</a>' . "\n";
1024
+					$html .= '<a href="'.esc_url ( $tab_link ).'" class="'.esc_attr ( $class ).'">'.esc_html ( $data[ 'title' ] ).'</a>'."\n";
1025 1025
 
1026 1026
 					++$c;
1027 1027
 				}
1028 1028
 
1029
-				$html .= '</h2>' . "\n";
1029
+				$html .= '</h2>'."\n";
1030 1030
 			}
1031 1031
 
1032
-			if ( isset( $_GET['settings-updated'] ) ) {
1032
+			if ( isset( $_GET[ 'settings-updated' ] ) ) {
1033 1033
 				$html .= '<br/><div class="updated notice notice-success is-dismissible">
1034
-					        <p>' . sprintf( __( '%1$s settings updated.', 'seriously-simple-podcasting' ), '<b>' . str_replace( '-', ' ', ucfirst( $tab ) ) . '</b>' ) . '</p>
1034
+					        <p>' . sprintf ( __ ( '%1$s settings updated.', 'seriously-simple-podcasting' ), '<b>'.str_replace ( '-', ' ', ucfirst ( $tab ) ).'</b>' ).'</p>
1035 1035
 					    </div>';
1036 1036
 			}
1037 1037
 
1038
-			if( function_exists( 'php_sapi_name') && 'security' == $tab ) {
1039
-				$sapi_type = php_sapi_name();
1040
-				if ( strpos( $sapi_type, 'fcgi' ) !== false ) {
1038
+			if ( function_exists ( 'php_sapi_name' ) && 'security' == $tab ) {
1039
+				$sapi_type = php_sapi_name ();
1040
+				if ( strpos ( $sapi_type, 'fcgi' ) !== false ) {
1041 1041
 				    $html .= '<br/><div class="update-nag">
1042
-					        <p>' . sprintf( __( 'It looks like your server has FastCGI enabled, which will prevent the feed password protection feature from working. You can fix this by following %1$sthis quick guide%2$s.', 'seriously-simple-podcasting' ), '<a href="http://www.seriouslysimplepodcasting.com/documentation/why-does-the-feed-password-protection-feature-not-work/" target="_blank">', '</a>' ) . '</p>
1042
+					        <p>' . sprintf ( __ ( 'It looks like your server has FastCGI enabled, which will prevent the feed password protection feature from working. You can fix this by following %1$sthis quick guide%2$s.', 'seriously-simple-podcasting' ), '<a href="http://www.seriouslysimplepodcasting.com/documentation/why-does-the-feed-password-protection-feature-not-work/" target="_blank">', '</a>' ).'</p>
1043 1043
 					    </div>';
1044 1044
 				}
1045 1045
 			}
@@ -1048,23 +1048,23 @@  discard block
 block discarded – undo
1048 1048
 
1049 1049
 			// Series submenu for feed details
1050 1050
 			if ( 'feed-details' == $tab ) {
1051
-				$series = get_terms( 'series', array( 'hide_empty' => false ) );
1051
+				$series = get_terms ( 'series', array( 'hide_empty' => false ) );
1052 1052
 
1053 1053
 				if ( ! empty( $series ) ) {
1054 1054
 
1055
-					if ( isset( $_GET['feed-series'] ) && $_GET['feed-series'] && 'default' != $_GET['feed-series'] ) {
1056
-						$current_series = esc_attr( $_GET['feed-series'] );
1055
+					if ( isset( $_GET[ 'feed-series' ] ) && $_GET[ 'feed-series' ] && 'default' != $_GET[ 'feed-series' ] ) {
1056
+						$current_series = esc_attr ( $_GET[ 'feed-series' ] );
1057 1057
 						$series_class = '';
1058 1058
 					} else {
1059 1059
 						$current_series = 'default';
1060 1060
 						$series_class = 'current';
1061 1061
 					}
1062 1062
 
1063
-					$html .= '<div class="feed-series-list-container">' . "\n";
1064
-						$html .= '<span id="feed-series-toggle" class="series-open" title="' . __( 'Toggle series list display', 'seriously-simple-podcasting' ) . '"></span>' . "\n";
1063
+					$html .= '<div class="feed-series-list-container">'."\n";
1064
+						$html .= '<span id="feed-series-toggle" class="series-open" title="'.__ ( 'Toggle series list display', 'seriously-simple-podcasting' ).'"></span>'."\n";
1065 1065
 
1066
-						$html .= '<ul id="feed-series-list" class="subsubsub series-open">' . "\n";
1067
-							$html .= '<li><a href="' . add_query_arg( array( 'feed-series' => 'default', 'settings-updated' => false ) ) . '" class="' . $series_class . '">' . __( 'Default feed', 'seriously-simple-podcasting' ) . '</a></li>';
1066
+						$html .= '<ul id="feed-series-list" class="subsubsub series-open">'."\n";
1067
+							$html .= '<li><a href="'.add_query_arg ( array( 'feed-series' => 'default', 'settings-updated' => false ) ).'" class="'.$series_class.'">'.__ ( 'Default feed', 'seriously-simple-podcasting' ).'</a></li>';
1068 1068
 
1069 1069
 							foreach ( $series as $s ) {
1070 1070
 
@@ -1074,39 +1074,39 @@  discard block
 block discarded – undo
1074 1074
 									$series_class = '';
1075 1075
 								}
1076 1076
 
1077
-								$html .= '<li>' . "\n";
1078
-									$html .= ' | <a href="' . esc_url( add_query_arg( array( 'feed-series' => $s->slug, 'settings-updated' => false ) ) ) . '" class="' . $series_class . '">' . $s->name . '</a>' . "\n";
1079
-								$html .= '</li>' . "\n";
1077
+								$html .= '<li>'."\n";
1078
+									$html .= ' | <a href="'.esc_url ( add_query_arg ( array( 'feed-series' => $s->slug, 'settings-updated' => false ) ) ).'" class="'.$series_class.'">'.$s->name.'</a>'."\n";
1079
+								$html .= '</li>'."\n";
1080 1080
 							}
1081 1081
 
1082
-						$html .= '</ul>' . "\n";
1083
-						$html .= '<br class="clear" />' . "\n";
1084
-					$html .= '</div>' . "\n";
1082
+						$html .= '</ul>'."\n";
1083
+						$html .= '<br class="clear" />'."\n";
1084
+					$html .= '</div>'."\n";
1085 1085
 
1086 1086
 				}
1087 1087
 			}
1088 1088
 
1089
-			$html .= '<form method="post" action="options.php" enctype="multipart/form-data">' . "\n";
1089
+			$html .= '<form method="post" action="options.php" enctype="multipart/form-data">'."\n";
1090 1090
 
1091 1091
 				// Add current series to posted data
1092 1092
 				if ( $current_series ) {
1093
-					$html .= '<input type="hidden" name="feed-series" value="' . esc_attr( $current_series ) . '" />' . "\n";
1093
+					$html .= '<input type="hidden" name="feed-series" value="'.esc_attr ( $current_series ).'" />'."\n";
1094 1094
 				}
1095 1095
 
1096 1096
 				// Get settings fields
1097
-				ob_start();
1098
-				settings_fields( 'ss_podcasting' );
1099
-				do_settings_sections( 'ss_podcasting' );
1100
-				$html .= ob_get_clean();
1097
+				ob_start ();
1098
+				settings_fields ( 'ss_podcasting' );
1099
+				do_settings_sections ( 'ss_podcasting' );
1100
+				$html .= ob_get_clean ();
1101 1101
 
1102 1102
 				// Submit button
1103
-				$html .= '<p class="submit">' . "\n";
1104
-					$html .= '<input type="hidden" name="tab" value="' . esc_attr( $tab ) . '" />' . "\n";
1105
-					$html .= '<input name="Submit" type="submit" class="button-primary" value="' . esc_attr( __( 'Save Settings' , 'seriously-simple-podcasting' ) ) . '" />' . "\n";
1106
-				$html .= '</p>' . "\n";
1103
+				$html .= '<p class="submit">'."\n";
1104
+					$html .= '<input type="hidden" name="tab" value="'.esc_attr ( $tab ).'" />'."\n";
1105
+					$html .= '<input name="Submit" type="submit" class="button-primary" value="'.esc_attr ( __ ( 'Save Settings', 'seriously-simple-podcasting' ) ).'" />'."\n";
1106
+				$html .= '</p>'."\n";
1107 1107
 
1108
-			$html .= '</form>' . "\n";
1109
-		$html .= '</div>' . "\n";
1108
+			$html .= '</form>'."\n";
1109
+		$html .= '</div>'."\n";
1110 1110
 
1111 1111
 	  	echo $html;
1112 1112
 	}
Please login to merge, or discard this patch.
includes/shortcodes/class-ssp-shortcode-podcast_episode.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly.
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if ( ! defined ( 'ABSPATH' ) ) {
4 4
 	exit;
5 5
 }
6 6
 
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
 	 * @param  array  $params Shortcode paramaters
20 20
 	 * @return string         HTML output
21 21
 	 */
22
-	public function shortcode ( $params ) {
22
+	public function shortcode( $params ) {
23 23
 		global $ss_podcasting;
24 24
 
25
-		$atts = shortcode_atts( array(
25
+		$atts = shortcode_atts ( array(
26 26
 	        'episode' => 0,
27 27
 	        'content' => 'title,player,details',
28 28
 	    ), $params );
29 29
 
30
-		extract( $atts );
30
+		extract ( $atts );
31 31
 
32 32
 		// If no episode ID is specified then use the current post's ID
33 33
 	    if ( ! $episode ) {
34 34
 
35 35
 	    	global $post;
36
-	    	if( isset( $post->ID ) ) {
37
-	    		$episode = intval( $post->ID );
36
+	    	if ( isset( $post->ID ) ) {
37
+	    		$episode = intval ( $post->ID );
38 38
 	    	}
39 39
 
40 40
 	    	if ( ! $episode ) {
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 	    }
45 45
 
46 46
 	    // Setup array of content items and trim whitespace
47
-	    $content_items = explode( ',', $content );
48
-	    $content_items = array_map( 'trim', $content_items );
47
+	    $content_items = explode ( ',', $content );
48
+	    $content_items = array_map ( 'trim', $content_items );
49 49
 
50 50
 	    // Get episode for display
51
-	    $html = $ss_podcasting->podcast_episode( $episode, $content_items, 'shortcode' );
51
+	    $html = $ss_podcasting->podcast_episode ( $episode, $content_items, 'shortcode' );
52 52
 
53 53
 	    return $html;
54 54
 
@@ -56,4 +56,4 @@  discard block
 block discarded – undo
56 56
 
57 57
 }
58 58
 
59
-$GLOBALS['ssp_shortcodes']['podcast_episode'] = new SSP_Shortcode_Podcast_Episode();
60 59
\ No newline at end of file
60
+$GLOBALS[ 'ssp_shortcodes' ][ 'podcast_episode' ] = new SSP_Shortcode_Podcast_Episode ();
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
includes/ssp-functions.php 1 patch
Spacing   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
8
-if ( ! function_exists( 'is_podcast_download' ) ) {
8
+if ( ! function_exists ( 'is_podcast_download' ) ) {
9 9
 	/**
10 10
 	 * Check if podcast file is being downloaded
11 11
 	 * @since  1.5
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
 
17 17
 		$download = $episode = false;
18 18
 
19
-		if ( isset( $wp_query->query_vars['podcast_episode'] ) && $wp_query->query_vars['podcast_episode'] ) {
19
+		if ( isset( $wp_query->query_vars[ 'podcast_episode' ] ) && $wp_query->query_vars[ 'podcast_episode' ] ) {
20 20
 			$download = true;
21
-			$episode = intval( $wp_query->query_vars['podcast_episode'] );
21
+			$episode = intval ( $wp_query->query_vars[ 'podcast_episode' ] );
22 22
 		}
23 23
 
24
-		return apply_filters( 'ssp_is_podcast_download', $download, $episode );
24
+		return apply_filters ( 'ssp_is_podcast_download', $download, $episode );
25 25
 	}
26 26
 }
27 27
 
28
-if ( ! function_exists( 'ss_get_podcast' ) ) {
28
+if ( ! function_exists ( 'ss_get_podcast' ) ) {
29 29
 	/**
30 30
 	 * Wrapper function to get the podcast episodes from the SeriouslySimplePodcasting class.
31 31
 	 * @param  mixed $args  Arguments
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	function ss_get_podcast( $args = '' ) {
36 36
 		global $ss_podcasting;
37
-		return $ss_podcasting->get_podcast( $args );
37
+		return $ss_podcasting->get_podcast ( $args );
38 38
 	}
39 39
 }
40 40
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
  * Enable the usage of do_action( 'get_podcast' ) to display podcast within a theme/plugin.
43 43
  * @since  1.0.0
44 44
  */
45
-add_action( 'get_podcast', 'ss_podcast' );
45
+add_action ( 'get_podcast', 'ss_podcast' );
46 46
 
47
-if ( ! function_exists( 'ss_podcast' ) ) {
47
+if ( ! function_exists ( 'ss_podcast' ) ) {
48 48
 	/**
49 49
 	 * Display or return HTML-formatted podcast data.
50 50
 	 * @param  mixed $args Arguments
@@ -66,57 +66,57 @@  discard block
 block discarded – undo
66 66
 			'after_title' => '</h3>'
67 67
 		);
68 68
 
69
-		$args = wp_parse_args( $args, $defaults );
69
+		$args = wp_parse_args ( $args, $defaults );
70 70
 
71 71
 		// Allow child themes/plugins to filter here
72
-		$args = apply_filters( 'ssp_podcast_args', $args );
72
+		$args = apply_filters ( 'ssp_podcast_args', $args );
73 73
 		$html = '';
74 74
 
75
-		do_action( 'ssp_podcast_before', $args );
75
+		do_action ( 'ssp_podcast_before', $args );
76 76
 
77 77
 		// The Query
78
-		$query = ss_get_podcast( $args );
78
+		$query = ss_get_podcast ( $args );
79 79
 
80 80
 		// The Display
81
-		if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
82
-			$html .= $args['before'] . "\n";
81
+		if ( ! is_wp_error ( $query ) && is_array ( $query ) && count ( $query ) > 0 ) {
82
+			$html .= $args[ 'before' ]."\n";
83 83
 
84
-			if ( '' != $args['title'] ) {
85
-				$html .= $args['before_title'] . esc_html( $args['title'] ) . $args['after_title'] . "\n";
84
+			if ( '' != $args[ 'title' ] ) {
85
+				$html .= $args[ 'before_title' ].esc_html ( $args[ 'title' ] ).$args[ 'after_title' ]."\n";
86 86
 			}
87 87
 
88
-			$html .= '<div class="ss_podcast">' . "\n";
88
+			$html .= '<div class="ss_podcast">'."\n";
89 89
 
90 90
 			// Begin templating logic.
91 91
 			$tpl = '<div class="%%CLASS%%"><h4 class="podcast-title">%%TITLE%%</h4><aside class="meta">%%META%%</aside></div>';
92
-			$tpl = apply_filters( 'ssp_podcast_item_template', $tpl, $args );
92
+			$tpl = apply_filters ( 'ssp_podcast_item_template', $tpl, $args );
93 93
 
94
-			if ( $query['content'] == 'episodes' ) {
94
+			if ( $query[ 'content' ] == 'episodes' ) {
95 95
 
96 96
 				$i = 0;
97 97
 				foreach ( $query as $post ) {
98 98
 
99
-					if ( ! is_object( $post ) ) {
99
+					if ( ! is_object ( $post ) ) {
100 100
 						continue;
101 101
 					}
102 102
 
103 103
 					$template = $tpl;
104 104
 					$i++;
105 105
 
106
-					setup_postdata( $post );
106
+					setup_postdata ( $post );
107 107
 
108 108
 					$class = 'podcast';
109 109
 
110
-					$title = get_the_title();
111
-					if ( true == $args['link_title'] ) {
112
-						$title = '<a href="' . esc_url( $post->url ) . '" title="' . esc_attr( $title ) . '">' . $title . '</a>';
110
+					$title = get_the_title ();
111
+					if ( true == $args[ 'link_title' ] ) {
112
+						$title = '<a href="'.esc_url ( $post->url ).'" title="'.esc_attr ( $title ).'">'.$title.'</a>';
113 113
 					}
114 114
 
115
-					$meta = $ss_podcasting->episode_meta( $post->ID, 'shortcode' );
115
+					$meta = $ss_podcasting->episode_meta ( $post->ID, 'shortcode' );
116 116
 
117
-					$template = str_replace( '%%CLASS%%', $class, $template );
118
-					$template = str_replace( '%%TITLE%%', $title, $template );
119
-					$template = str_replace( '%%META%%', $meta, $template );
117
+					$template = str_replace ( '%%CLASS%%', $class, $template );
118
+					$template = str_replace ( '%%TITLE%%', $title, $template );
119
+					$template = str_replace ( '%%META%%', $meta, $template );
120 120
 
121 121
 					$html .= $template;
122 122
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 				$i = 0;
128 128
 				foreach ( $query as $series ) {
129 129
 
130
-					if ( ! is_object( $series ) ) continue;
130
+					if ( ! is_object ( $series ) ) continue;
131 131
 
132 132
 					$template = $tpl;
133 133
 					$i++;
@@ -135,15 +135,15 @@  discard block
 block discarded – undo
135 135
 					$class = 'podcast';
136 136
 
137 137
 					$title = $series->title;
138
-					if ( true == $args['link_title'] ) {
139
-						$title = '<a href="' . esc_url( $series->url ) . '" title="' . esc_attr( $title ) . '">' . $title . '</a>';
138
+					if ( true == $args[ 'link_title' ] ) {
139
+						$title = '<a href="'.esc_url ( $series->url ).'" title="'.esc_attr ( $title ).'">'.$title.'</a>';
140 140
 					}
141 141
 
142
-					$template = str_replace( '%%CLASS%%', $class, $template );
143
-					$template = str_replace( '%%TITLE%%', $title, $template );
142
+					$template = str_replace ( '%%CLASS%%', $class, $template );
143
+					$template = str_replace ( '%%TITLE%%', $title, $template );
144 144
 
145
-					$meta = $series->count . __( ' episodes' , 'seriously-simple-podcasting' );
146
-					$template = str_replace( '%%META%%' , $meta , $template );
145
+					$meta = $series->count.__ ( ' episodes', 'seriously-simple-podcasting' );
146
+					$template = str_replace ( '%%META%%', $meta, $template );
147 147
 
148 148
 					$html .= $template;
149 149
 
@@ -151,40 +151,40 @@  discard block
 block discarded – undo
151 151
 
152 152
 			}
153 153
 
154
-			$html .= '<div class="fix"></div>' . "\n";
154
+			$html .= '<div class="fix"></div>'."\n";
155 155
 
156
-			$html .= '</div><!--/.ss_podcast-->' . "\n";
157
-			$html .= $args['after'] . "\n";
156
+			$html .= '</div><!--/.ss_podcast-->'."\n";
157
+			$html .= $args[ 'after' ]."\n";
158 158
 
159
-			wp_reset_postdata();
159
+			wp_reset_postdata ();
160 160
 		}
161 161
 
162 162
 		// Allow themes/plugins to filter here
163
-		$html = apply_filters( 'ssp_podcast_html', $html, $query, $args );
163
+		$html = apply_filters ( 'ssp_podcast_html', $html, $query, $args );
164 164
 
165
-		if ( ! $args['echo'] ) {
165
+		if ( ! $args[ 'echo' ] ) {
166 166
 			return $html;
167 167
 		}
168 168
 
169 169
 		// Should only run if "echo" is set to true
170 170
 		echo $html;
171 171
 
172
-		do_action( 'ssp_podcast_after', $args );
172
+		do_action ( 'ssp_podcast_after', $args );
173 173
 	}
174 174
 }
175 175
 
176
-if ( ! function_exists( 'ssp_episode_ids' ) ) {
176
+if ( ! function_exists ( 'ssp_episode_ids' ) ) {
177 177
 
178 178
 	/**
179 179
 	 * Get post IDs of all podcast episodes for all post types
180 180
 	 * @since  1.8.2
181 181
 	 * @return array
182 182
 	 */
183
-	function ssp_episode_ids () {
183
+	function ssp_episode_ids() {
184 184
 		global $ss_podcasting;
185 185
 
186 186
 		// Remove action to prevent infinite loop
187
-		remove_action( 'pre_get_posts', array( $ss_podcasting, 'add_all_post_types' ) );
187
+		remove_action ( 'pre_get_posts', array( $ss_podcasting, 'add_all_post_types' ) );
188 188
 
189 189
 		// Setup the default args
190 190
 		$args = array(
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 		);
196 196
 
197 197
 		// Do we have any additional post types to add?
198
-		$podcast_post_types = ssp_post_types( false );
198
+		$podcast_post_types = ssp_post_types ( false );
199 199
 
200 200
 		if ( ! empty( $podcast_post_types ) ) {
201
-			$args['post_type']  = ssp_post_types();
202
-			$args['meta_query'] = array(
201
+			$args[ 'post_type' ]  = ssp_post_types ();
202
+			$args[ 'meta_query' ] = array(
203 203
 				array(
204 204
 					'key'     => 'audio_file',
205 205
 					'compare' => '!=',
@@ -211,23 +211,23 @@  discard block
 block discarded – undo
211 211
 		// Do we have this stored in the cache?
212 212
 		$key   = 'episode_ids';
213 213
 		$group = 'ssp';
214
-		$podcast_episodes = wp_cache_get( $key, $group );
214
+		$podcast_episodes = wp_cache_get ( $key, $group );
215 215
 
216 216
 		// If nothing in cache then fetch episodes again and store in cache
217 217
 		if ( $podcast_episodes === false ) {
218
-			$podcast_episodes = get_posts( $args );
219
-			wp_cache_set( $key, $podcast_episodes, $group, HOUR_IN_SECONDS * 12 );
218
+			$podcast_episodes = get_posts ( $args );
219
+			wp_cache_set ( $key, $podcast_episodes, $group, HOUR_IN_SECONDS * 12 );
220 220
 		}
221 221
 
222 222
 		// Reinstate action for future queries
223
-		add_action( 'pre_get_posts', array( $ss_podcasting, 'add_all_post_types' ) );
223
+		add_action ( 'pre_get_posts', array( $ss_podcasting, 'add_all_post_types' ) );
224 224
 
225 225
 		return $podcast_episodes;
226 226
 	}
227 227
 
228 228
 }
229 229
 
230
-if ( ! function_exists( 'ssp_episodes' ) ) {
230
+if ( ! function_exists ( 'ssp_episodes' ) ) {
231 231
 
232 232
 	/**
233 233
 	 * Fetch all podcast episodes
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
 	 * @since  1.8.2
239 239
 	 * @return array                Array of posts or array of query args
240 240
 	 */
241
-	function ssp_episodes ( $n = 10, $series = '', $return_args = false, $context = '' ) {
241
+	function ssp_episodes( $n = 10, $series = '', $return_args = false, $context = '' ) {
242 242
 
243 243
 		// Get all podcast episodes IDs
244
-		$episode_ids = (array) ssp_episode_ids();
244
+		$episode_ids = (array) ssp_episode_ids ();
245 245
 
246 246
 		if ( $context === 'glance' ) {
247 247
 			return $episode_ids;
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 		}
253 253
 
254 254
 		// Get all valid podcast post types
255
-		$podcast_post_types = ssp_post_types( true );
255
+		$podcast_post_types = ssp_post_types ( true );
256 256
 
257 257
 		if ( empty ( $podcast_post_types ) ) {
258 258
 			return array();
@@ -268,24 +268,24 @@  discard block
 block discarded – undo
268 268
 		);
269 269
 
270 270
 		if ( $series ) {
271
-			$args['series'] = esc_attr( $series );
271
+			$args[ 'series' ] = esc_attr ( $series );
272 272
 		}
273 273
 
274
-		$args = apply_filters( 'ssp_episode_query_args', $args, $context );
274
+		$args = apply_filters ( 'ssp_episode_query_args', $args, $context );
275 275
 
276 276
 		if ( $return_args ) {
277 277
 			return $args;
278 278
 		}
279 279
 
280 280
 		// Do we have anything in the cache here?
281
-		$key   = 'episodes_' . $series;
281
+		$key   = 'episodes_'.$series;
282 282
 		$group = 'ssp';
283
-		$posts = wp_cache_get( $key, $group );
283
+		$posts = wp_cache_get ( $key, $group );
284 284
 
285 285
 		// If nothing in cache then fetch episodes again and store in cache
286 286
 		if ( $posts === false ) {
287
-			$posts = get_posts( $args );
288
-			wp_cache_add( $key, $posts, $group, HOUR_IN_SECONDS * 12 );
287
+			$posts = get_posts ( $args );
288
+			wp_cache_add ( $key, $posts, $group, HOUR_IN_SECONDS * 12 );
289 289
 		}
290 290
 
291 291
 		return $posts;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 
294 294
 }
295 295
 
296
-if ( ! function_exists( 'ssp_post_types' ) ) {
296
+if ( ! function_exists ( 'ssp_post_types' ) ) {
297 297
 
298 298
 	/**
299 299
 	 * Fetch all valid podcast post types
@@ -301,14 +301,14 @@  discard block
 block discarded – undo
301 301
 	 * @since  1.8.7
302 302
 	 * @return array                    Array of podcast post types
303 303
 	 */
304
-	function ssp_post_types ( $include_podcast = true ) {
304
+	function ssp_post_types( $include_podcast = true ) {
305 305
 
306 306
 		// Get saved podcast post type option
307
-		$podcast_post_types = get_option( 'ss_podcasting_use_post_types', array() );
307
+		$podcast_post_types = get_option ( 'ss_podcasting_use_post_types', array() );
308 308
 
309 309
 		// Add `podcast` post type to array if required
310 310
 		if ( $include_podcast ) {
311
-			$podcast_post_types[] = 'podcast';
311
+			$podcast_post_types[ ] = 'podcast';
312 312
 		}
313 313
 
314 314
 		$valid_podcast_post_types = array();
@@ -317,36 +317,36 @@  discard block
 block discarded – undo
317 317
 		if ( ! empty( $podcast_post_types ) ) {
318 318
 
319 319
 			foreach ( $podcast_post_types as $type ) {
320
-				if ( post_type_exists( $type ) ) {
321
-					$valid_podcast_post_types[] = $type;
320
+				if ( post_type_exists ( $type ) ) {
321
+					$valid_podcast_post_types[ ] = $type;
322 322
 				}
323 323
 			}
324 324
 
325 325
 		}
326 326
 
327 327
 		// Return only the valid podcast post types
328
-		return apply_filters( 'ssp_podcast_post_types', $valid_podcast_post_types, $include_podcast );
328
+		return apply_filters ( 'ssp_podcast_post_types', $valid_podcast_post_types, $include_podcast );
329 329
 	}
330 330
 }
331 331
 
332
-if( ! function_exists( 'ssp_get_feed_category_output' ) ) {
332
+if ( ! function_exists ( 'ssp_get_feed_category_output' ) ) {
333 333
 
334 334
 	/**
335 335
 	 * Get the XML markup for the feed category at the specified level
336 336
 	 * @param  int    $level Category level
337 337
 	 * @return string        XML output for feed vategory
338 338
 	 */
339
-	function ssp_get_feed_category_output ( $level = 1, $series_id ) {
339
+	function ssp_get_feed_category_output( $level = 1, $series_id ) {
340 340
 
341 341
 		$level = (int) $level;
342 342
 
343
-		if( 1 == $level ) {
343
+		if ( 1 == $level ) {
344 344
 			$level = '';
345 345
 		}
346 346
 
347
-		$category = get_option( 'ss_podcasting_data_category' . $level, '' );
347
+		$category = get_option ( 'ss_podcasting_data_category'.$level, '' );
348 348
 		if ( $series_id ) {
349
-			$series_category = get_option( 'ss_podcasting_data_category' . $level . '_' . $series_id, 'no-category' );
349
+			$series_category = get_option ( 'ss_podcasting_data_category'.$level.'_'.$series_id, 'no-category' );
350 350
 			if ( 'no-category' != $series_category ) {
351 351
 				$category = $series_category;
352 352
 			}
@@ -355,21 +355,21 @@  discard block
 block discarded – undo
355 355
 			$category = '';
356 356
 			$subcategory = '';
357 357
 		} else {
358
-			$subcategory = get_option( 'ss_podcasting_data_subcategory' . $level, '' );
358
+			$subcategory = get_option ( 'ss_podcasting_data_subcategory'.$level, '' );
359 359
 			if ( $series_id ) {
360
-				$series_subcategory = get_option( 'ss_podcasting_data_subcategory' . $level . '_' . $series_id, 'no-subcategory' );
360
+				$series_subcategory = get_option ( 'ss_podcasting_data_subcategory'.$level.'_'.$series_id, 'no-subcategory' );
361 361
 				if ( 'no-subcategory' != $series_subcategory ) {
362 362
 					$subcategory = $series_subcategory;
363 363
 				}
364 364
 			}
365 365
 		}
366 366
 
367
-		return apply_filters( 'ssp_feed_category_output', array( 'category' => $category, 'subcategory' => $subcategory ), $level, $series_id );
367
+		return apply_filters ( 'ssp_feed_category_output', array( 'category' => $category, 'subcategory' => $subcategory ), $level, $series_id );
368 368
 	}
369 369
 
370 370
 }
371 371
 
372
-if ( ! function_exists( 'ssp_readfile_chunked' ) ) {
372
+if ( ! function_exists ( 'ssp_readfile_chunked' ) ) {
373 373
 
374 374
 	/**
375 375
 	 * Reads file in chunks so big downloads are possible without changing PHP.INI - http://codeigniter.com/wiki/Download_helper_for_large_files/
@@ -384,23 +384,23 @@  discard block
 block discarded – undo
384 384
 		$chunksize = 1 * ( 1024 * 1024 );
385 385
 		$cnt = 0;
386 386
 
387
-		$handle = fopen( $file, 'r' );
387
+		$handle = fopen ( $file, 'r' );
388 388
 		if ( $handle === false ) {
389 389
 			return false;
390 390
 		}
391 391
 
392
-		while ( ! feof( $handle ) ) {
393
-			$buffer = fread( $handle, $chunksize );
392
+		while ( ! feof ( $handle ) ) {
393
+			$buffer = fread ( $handle, $chunksize );
394 394
 			echo $buffer;
395
-			ob_flush();
396
-			flush();
395
+			ob_flush ();
396
+			flush ();
397 397
 
398 398
 			if ( $retbytes ) {
399
-				$cnt += strlen( $buffer );
399
+				$cnt += strlen ( $buffer );
400 400
 			}
401 401
 		}
402 402
 
403
-		$status = fclose( $handle );
403
+		$status = fclose ( $handle );
404 404
 
405 405
 		if ( $retbytes && $status ) {
406 406
 			return $cnt;
Please login to merge, or discard this patch.
includes/shortcodes/class-ssp-shortcode-ss_podcast.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly.
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if ( ! defined ( 'ABSPATH' ) ) {
4 4
 	exit;
5 5
 }
6 6
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	 * @param  array  $params  Shortcode attributes
20 20
 	 * @return string          HTML output
21 21
 	 */
22
-	function shortcode ( $params ) {
22
+	function shortcode( $params ) {
23 23
 
24 24
 		$defaults = array(
25 25
 			'title' => '',
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 			'link_title' => true
31 31
 		);
32 32
 
33
-		$args = shortcode_atts( $defaults, $params, 'ss_podcast' );
33
+		$args = shortcode_atts ( $defaults, $params, 'ss_podcast' );
34 34
 
35 35
 		// Make sure we return and don't echo.
36
-		$args['echo'] = false;
36
+		$args[ 'echo' ] = false;
37 37
 
38
-		return ss_podcast( $args );
38
+		return ss_podcast ( $args );
39 39
 	}
40 40
 
41 41
 }
42 42
 
43
-$GLOBALS['ssp_shortcodes']['ss_podcast'] = new SSP_Shortcode_SS_Podcast();
44 43
\ No newline at end of file
44
+$GLOBALS[ 'ssp_shortcodes' ][ 'ss_podcast' ] = new SSP_Shortcode_SS_Podcast ();
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
includes/shortcodes/class-ssp-shortcode-podcast_playlist.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly.
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if ( ! defined ( 'ABSPATH' ) ) {
4 4
 	exit;
5 5
 }
6 6
 
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
 		$instance++;
27 27
 
28 28
 		// Get all podcast post types
29
-		$podcast_post_types = ssp_post_types( true );
29
+		$podcast_post_types = ssp_post_types ( true );
30 30
 
31 31
 		// Get list of episode IDs for display from `episodes` parameter
32
-		if ( ! empty( $params['episodes'] ) ) {
32
+		if ( ! empty( $params[ 'episodes' ] ) ) {
33 33
 			// 'episodes' is explicitly ordered, unless you specify otherwise.
34
-			if ( empty( $params['orderby'] ) ) {
35
-				$params['orderby'] = 'post__in';
34
+			if ( empty( $params[ 'orderby' ] ) ) {
35
+				$params[ 'orderby' ] = 'post__in';
36 36
 			}
37
-			$params['include'] = $params['episodes'];
37
+			$params[ 'include' ] = $params[ 'episodes' ];
38 38
 		}
39 39
 
40 40
 		// Parse shortcode attributes
41
-		$atts = shortcode_atts( array(
41
+		$atts = shortcode_atts ( array(
42 42
 			'type'		=> 'audio',
43 43
 			'series'	=> '',
44 44
 			'order'		=> 'ASC',
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
 		), $params, 'podcast_playlist' );
53 53
 
54 54
 		// Included posts must be passed as an array
55
-		if( $atts['include'] ) {
56
-			$atts['include'] = explode( ',', $atts['include'] );
55
+		if ( $atts[ 'include' ] ) {
56
+			$atts[ 'include' ] = explode ( ',', $atts[ 'include' ] );
57 57
 		}
58 58
 
59 59
 		// Excluded posts must be passed as an array
60
-		if( $atts['exclude'] ) {
61
-			$atts['exclude'] = explode( ',', $atts['exclude'] );
60
+		if ( $atts[ 'exclude' ] ) {
61
+			$atts[ 'exclude' ] = explode ( ',', $atts[ 'exclude' ] );
62 62
 		}
63 63
 
64 64
 		// Set up query rguments for fetching podcast episodes
@@ -66,33 +66,33 @@  discard block
 block discarded – undo
66 66
 			'post_status'         => 'publish',
67 67
 			'post_type'           => $podcast_post_types,
68 68
 			'posts_per_page'      => -1,
69
-			'order'				  => $atts['order'],
70
-			'orderby'			  => $atts['orderby'],
69
+			'order'				  => $atts[ 'order' ],
70
+			'orderby'			  => $atts[ 'orderby' ],
71 71
 			'ignore_sticky_posts' => true,
72
-			'post__in'            => $atts['include'],
73
-			'post__not_in'        => $atts['exclude'],
72
+			'post__in'            => $atts[ 'include' ],
73
+			'post__not_in'        => $atts[ 'exclude' ],
74 74
 		);
75 75
 
76 76
 		// Limit query to episodes in defined series only
77
-		if ( $atts['series'] ) {
77
+		if ( $atts[ 'series' ] ) {
78 78
 
79
-			$query_args['tax_query'] = array(
79
+			$query_args[ 'tax_query' ] = array(
80 80
 				array(
81 81
 					'taxonomy' => 'series',
82 82
 					'field' => 'slug',
83
-					'terms' => $atts['series'],
83
+					'terms' => $atts[ 'series' ],
84 84
 				),
85 85
 			);
86 86
 
87 87
 		}
88 88
 
89 89
 		// Allow dynamic filtering of query args
90
-		$query_args = apply_filters( 'ssp_podcast_playlist_query_args', $query_args );
90
+		$query_args = apply_filters ( 'ssp_podcast_playlist_query_args', $query_args );
91 91
 
92 92
 		// Fetch all episodes for display
93
-		$episodes = get_posts( $query_args );
93
+		$episodes = get_posts ( $query_args );
94 94
 
95
-		if( empty ( $episodes ) ) {
95
+		if ( empty ( $episodes ) ) {
96 96
 			return;
97 97
 		}
98 98
 
@@ -102,30 +102,30 @@  discard block
 block discarded – undo
102 102
 		$default_height = 360;
103 103
 
104 104
 		$theme_width = empty( $content_width ) ? $default_width : ( $content_width - $outer );
105
-		$theme_height = empty( $content_width ) ? $default_height : round( ( $default_height * $theme_width ) / $default_width );
105
+		$theme_height = empty( $content_width ) ? $default_height : round ( ( $default_height * $theme_width ) / $default_width );
106 106
 
107 107
 		$data = array(
108
-			'type' => $atts['type'],
108
+			'type' => $atts[ 'type' ],
109 109
 			// don't pass strings to JSON, will be truthy in JS
110
-			'tracklist' => wp_validate_boolean( $atts['tracklist'] ),
111
-			'tracknumbers' => wp_validate_boolean( $atts['tracknumbers'] ),
112
-			'images' => wp_validate_boolean( $atts['images'] ),
110
+			'tracklist' => wp_validate_boolean ( $atts[ 'tracklist' ] ),
111
+			'tracknumbers' => wp_validate_boolean ( $atts[ 'tracknumbers' ] ),
112
+			'images' => wp_validate_boolean ( $atts[ 'images' ] ),
113 113
 			'artists' => false,
114 114
 		);
115 115
 
116 116
 		$tracks = array();
117 117
 		foreach ( $episodes as $episode ) {
118 118
 
119
-			$url = $ss_podcasting->get_enclosure( $episode->ID );
120
-			if ( get_option( 'permalink_structure' ) ) {
121
-				$url = $ss_podcasting->get_episode_download_link( $episode->ID );
122
-				$url = str_replace( 'podcast-download', 'podcast-player', $url );
119
+			$url = $ss_podcasting->get_enclosure ( $episode->ID );
120
+			if ( get_option ( 'permalink_structure' ) ) {
121
+				$url = $ss_podcasting->get_episode_download_link ( $episode->ID );
122
+				$url = str_replace ( 'podcast-download', 'podcast-player', $url );
123 123
 			}
124 124
 
125 125
 			// Get episode file type
126
-			$ftype = wp_check_filetype( $url, wp_get_mime_types() );
126
+			$ftype = wp_check_filetype ( $url, wp_get_mime_types () );
127 127
 
128
-			if( $episode->post_excerpt ) {
128
+			if ( $episode->post_excerpt ) {
129 129
 				$episode_excerpt = $episode->post_excerpt;
130 130
 			} else {
131 131
 				$episode_excerpt = $episode->post_title;
@@ -134,19 +134,19 @@  discard block
 block discarded – undo
134 134
 			// Setup episode data for media player
135 135
 			$track = array(
136 136
 				'src' => $url,
137
-				'type' => $ftype['type'],
137
+				'type' => $ftype[ 'type' ],
138 138
 				'caption' => $episode->post_title,
139 139
 				'title' => $episode_excerpt,
140 140
 				'description' => $episode->post_content,
141 141
 			);
142 142
 
143 143
 			// We don't need the ID3 meta data here, but still need to set an empty array
144
-			$track['meta'] = array();
144
+			$track[ 'meta' ] = array();
145 145
 
146 146
 			// Set video dimensions for player
147
-			if ( 'video' === $atts['type'] ) {
148
-				$track['dimensions'] = array(
149
-					'original' => compact( $default_width, $default_height ),
147
+			if ( 'video' === $atts[ 'type' ] ) {
148
+				$track[ 'dimensions' ] = array(
149
+					'original' => compact ( $default_width, $default_height ),
150 150
 					'resized' => array(
151 151
 						'width' => $theme_width,
152 152
 						'height' => $theme_height
@@ -155,27 +155,27 @@  discard block
 block discarded – undo
155 155
 			}
156 156
 
157 157
 			// Get episode image
158
-			if ( $atts['images'] ) {
159
-				$thumb_id = get_post_thumbnail_id( $episode->ID );
158
+			if ( $atts[ 'images' ] ) {
159
+				$thumb_id = get_post_thumbnail_id ( $episode->ID );
160 160
 				if ( ! empty( $thumb_id ) ) {
161
-					list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'full' );
162
-					$track['image'] = compact( 'src', 'width', 'height' );
163
-					list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'thumbnail' );
164
-					$track['thumb'] = compact( 'src', 'width', 'height' );
161
+					list( $src, $width, $height ) = wp_get_attachment_image_src ( $thumb_id, 'full' );
162
+					$track[ 'image' ] = compact ( 'src', 'width', 'height' );
163
+					list( $src, $width, $height ) = wp_get_attachment_image_src ( $thumb_id, 'thumbnail' );
164
+					$track[ 'thumb' ] = compact ( 'src', 'width', 'height' );
165 165
 				} else {
166
-					$track['image'] = '';
167
-					$track['thumb'] = '';
166
+					$track[ 'image' ] = '';
167
+					$track[ 'thumb' ] = '';
168 168
 				}
169 169
 			}
170 170
 
171
-			$tracks[] = $track;
171
+			$tracks[ ] = $track;
172 172
 		}
173
-		$data['tracks'] = $tracks;
173
+		$data[ 'tracks' ] = $tracks;
174 174
 
175
-		$safe_type = esc_attr( $atts['type'] );
176
-		$safe_style = esc_attr( $atts['style'] );
175
+		$safe_type = esc_attr ( $atts[ 'type' ] );
176
+		$safe_style = esc_attr ( $atts[ 'style' ] );
177 177
 
178
-		ob_start();
178
+		ob_start ();
179 179
 
180 180
 		if ( 1 === $instance ) {
181 181
 			/**
@@ -186,10 +186,10 @@  discard block
 block discarded – undo
186 186
 			 * @param string $type  Type of playlist. Possible values are 'audio' or 'video'.
187 187
 			 * @param string $style The 'theme' for the playlist. Core provides 'light' and 'dark'.
188 188
 			 */
189
-			do_action( 'wp_playlist_scripts', $atts['type'], $atts['style'] );
189
+			do_action ( 'wp_playlist_scripts', $atts[ 'type' ], $atts[ 'style' ] );
190 190
 		} ?>
191 191
 	<div class="wp-playlist wp-<?php echo $safe_type ?>-playlist wp-playlist-<?php echo $safe_style ?>">
192
-		<?php if ( 'audio' === $atts['type'] ): ?>
192
+		<?php if ( 'audio' === $atts[ 'type' ] ): ?>
193 193
 		<div class="wp-playlist-current-item"></div>
194 194
 		<?php endif ?>
195 195
 		<<?php echo $safe_type ?> controls="controls" preload="none" width="<?php
@@ -202,21 +202,21 @@  discard block
 block discarded – undo
202 202
 		<noscript>
203 203
 		<ol><?php
204 204
 		foreach ( $episodes as $episode ) {
205
-			$url = $ss_podcasting->get_enclosure( $episode->ID );
206
-			if ( get_option( 'permalink_structure' ) ) {
207
-				$url = $ss_podcasting->get_episode_download_link( $episode->ID );
208
-				$url = str_replace( 'podcast-download', 'podcast-player', $url );
205
+			$url = $ss_podcasting->get_enclosure ( $episode->ID );
206
+			if ( get_option ( 'permalink_structure' ) ) {
207
+				$url = $ss_podcasting->get_episode_download_link ( $episode->ID );
208
+				$url = str_replace ( 'podcast-download', 'podcast-player', $url );
209 209
 			}
210
-			printf( '<li>%s</li>', $url );
210
+			printf ( '<li>%s</li>', $url );
211 211
 		}
212 212
 		?></ol>
213 213
 		</noscript>
214
-		<script type="application/json" class="wp-playlist-script"><?php echo wp_json_encode( $data ) ?></script>
214
+		<script type="application/json" class="wp-playlist-script"><?php echo wp_json_encode ( $data ) ?></script>
215 215
 	</div>
216 216
 		<?php
217
-		return ob_get_clean();
217
+		return ob_get_clean ();
218 218
 	}
219 219
 
220 220
 }
221 221
 
222
-$GLOBALS['ssp_shortcodes']['podcast_playlist'] = new SSP_Shortcode_Podcast_Playlist();
223 222
\ No newline at end of file
223
+$GLOBALS[ 'ssp_shortcodes' ][ 'podcast_playlist' ] = new SSP_Shortcode_Podcast_Playlist ();
224 224
\ No newline at end of file
Please login to merge, or discard this patch.