Completed
Push — master ( d0f89d...8d008b )
by Hugh
02:54
created
includes/class-ssp-admin.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -658,7 +658,7 @@
 block discarded – undo
658 658
 	/**
659 659
 	 * Adding podcast episodes to 'At a glance' dashboard widget
660 660
 	 * @param  array $items Existing items
661
-	 * @return array        Updated items
661
+	 * @return string[]        Updated items
662 662
 	 */
663 663
 	public function glance_items( $items = array() ) {
664 664
 
Please login to merge, or discard this patch.
Indentation   +187 added lines, -187 removed lines patch added patch discarded remove patch
@@ -83,19 +83,19 @@  discard block
 block discarded – undo
83 83
 
84 84
 			// Series list table
85 85
 			add_filter( 'manage_edit-series_columns' , array( $this, 'edit_series_columns' ) );
86
-            add_filter( 'manage_series_custom_column' , array( $this, 'add_series_columns' ), 1, 3 );
86
+			add_filter( 'manage_series_custom_column' , array( $this, 'add_series_columns' ), 1, 3 );
87 87
 
88
-            // Dashboard widgets
89
-            add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
88
+			// Dashboard widgets
89
+			add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
90 90
 
91
-            // Appreciation links
92
-            add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
91
+			// Appreciation links
92
+			add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
93 93
 
94
-            // Add footer text to dashboard
95
-            add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
94
+			// Add footer text to dashboard
95
+			add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
96 96
 
97
-            // Clear the cache on post save.
98
-            add_action( 'save_post', array( $this, 'invalidate_cache' ), 10, 2 );
97
+			// Clear the cache on post save.
98
+			add_action( 'save_post', array( $this, 'invalidate_cache' ), 10, 2 );
99 99
 
100 100
 		}
101 101
 
@@ -195,77 +195,77 @@  discard block
 block discarded – undo
195 195
 
196 196
 		$podcast_post_types = ssp_post_types( true );
197 197
 
198
-        $series_labels = array(
199
-            'name' => __( 'Podcast Series' , 'seriously-simple-podcasting' ),
200
-            'singular_name' => __( 'Series', 'seriously-simple-podcasting' ),
201
-            'search_items' =>  __( 'Search Series' , 'seriously-simple-podcasting' ),
202
-            'all_items' => __( 'All Series' , 'seriously-simple-podcasting' ),
203
-            'parent_item' => __( 'Parent Series' , 'seriously-simple-podcasting' ),
204
-            'parent_item_colon' => __( 'Parent Series:' , 'seriously-simple-podcasting' ),
205
-            'edit_item' => __( 'Edit Series' , 'seriously-simple-podcasting' ),
206
-            'update_item' => __( 'Update Series' , 'seriously-simple-podcasting' ),
207
-            'add_new_item' => __( 'Add New Series' , 'seriously-simple-podcasting' ),
208
-            'new_item_name' => __( 'New Series Name' , 'seriously-simple-podcasting' ),
209
-            'menu_name' => __( 'Series' , 'seriously-simple-podcasting' ),
210
-            'view_item' => __( 'View Series' , 'seriously-simple-podcasting' ),
211
-            'popular_items' => __( 'Popular Series' , 'seriously-simple-podcasting' ),
212
-            'separate_items_with_commas' => __( 'Separate series with commas' , 'seriously-simple-podcasting' ),
213
-            'add_or_remove_items' => __( 'Add or remove Series' , 'seriously-simple-podcasting' ),
214
-            'choose_from_most_used' => __( 'Choose from the most used Series' , 'seriously-simple-podcasting' ),
215
-            'not_found' => __( 'No Series Found' , 'seriously-simple-podcasting' ),
216
-            'items_list_navigation' => __( 'Series list navigation' , 'seriously-simple-podcasting' ),
217
-            'items_list' => __( 'Series list' , 'seriously-simple-podcasting' ),
218
-        );
219
-
220
-        $series_args = array(
221
-            'public' => true,
222
-            'hierarchical' => true,
223
-            'rewrite' => array( 'slug' => apply_filters( 'ssp_series_slug', 'series' ) ),
224
-            'labels' => $series_labels,
225
-            'show_in_rest' => true,
226
-        );
227
-
228
-        $series_args = apply_filters( 'ssp_register_taxonomy_args', $series_args, 'series' );
229
-
230
-        register_taxonomy( 'series', $podcast_post_types, $series_args );
231
-
232
-        // Add Tags to podcast post type
233
-        if ( apply_filters( 'ssp_use_post_tags', true ) ) {
234
-        	register_taxonomy_for_object_type( 'post_tag', $this->token );
235
-        }
236
-    }
237
-
238
-    public function register_meta() {
239
-    	global $wp_version;
240
-
241
-    	// The enhanced register_meta function is only available for WordPress 4.6+
242
-    	if( version_compare( $wp_version, '4.6', '<' ) ) {
243
-    		return;
244
-    	}
245
-
246
-    	// Get all displayed custom fields
247
-    	$fields = $this->custom_fields();
248
-
249
-    	// Add 'filesize_raw' as this is not included in the displayed field options
250
-    	$fields['filesize_raw'] = array(
251
-    		'meta_description' => __( 'The raw file size of the podcast episode media file in bytes.', 'seriously-simple-podcasting' ),
198
+		$series_labels = array(
199
+			'name' => __( 'Podcast Series' , 'seriously-simple-podcasting' ),
200
+			'singular_name' => __( 'Series', 'seriously-simple-podcasting' ),
201
+			'search_items' =>  __( 'Search Series' , 'seriously-simple-podcasting' ),
202
+			'all_items' => __( 'All Series' , 'seriously-simple-podcasting' ),
203
+			'parent_item' => __( 'Parent Series' , 'seriously-simple-podcasting' ),
204
+			'parent_item_colon' => __( 'Parent Series:' , 'seriously-simple-podcasting' ),
205
+			'edit_item' => __( 'Edit Series' , 'seriously-simple-podcasting' ),
206
+			'update_item' => __( 'Update Series' , 'seriously-simple-podcasting' ),
207
+			'add_new_item' => __( 'Add New Series' , 'seriously-simple-podcasting' ),
208
+			'new_item_name' => __( 'New Series Name' , 'seriously-simple-podcasting' ),
209
+			'menu_name' => __( 'Series' , 'seriously-simple-podcasting' ),
210
+			'view_item' => __( 'View Series' , 'seriously-simple-podcasting' ),
211
+			'popular_items' => __( 'Popular Series' , 'seriously-simple-podcasting' ),
212
+			'separate_items_with_commas' => __( 'Separate series with commas' , 'seriously-simple-podcasting' ),
213
+			'add_or_remove_items' => __( 'Add or remove Series' , 'seriously-simple-podcasting' ),
214
+			'choose_from_most_used' => __( 'Choose from the most used Series' , 'seriously-simple-podcasting' ),
215
+			'not_found' => __( 'No Series Found' , 'seriously-simple-podcasting' ),
216
+			'items_list_navigation' => __( 'Series list navigation' , 'seriously-simple-podcasting' ),
217
+			'items_list' => __( 'Series list' , 'seriously-simple-podcasting' ),
252 218
 		);
253 219
 
254
-    	foreach( $fields as $key => $data ) {
220
+		$series_args = array(
221
+			'public' => true,
222
+			'hierarchical' => true,
223
+			'rewrite' => array( 'slug' => apply_filters( 'ssp_series_slug', 'series' ) ),
224
+			'labels' => $series_labels,
225
+			'show_in_rest' => true,
226
+		);
227
+
228
+		$series_args = apply_filters( 'ssp_register_taxonomy_args', $series_args, 'series' );
229
+
230
+		register_taxonomy( 'series', $podcast_post_types, $series_args );
231
+
232
+		// Add Tags to podcast post type
233
+		if ( apply_filters( 'ssp_use_post_tags', true ) ) {
234
+			register_taxonomy_for_object_type( 'post_tag', $this->token );
235
+		}
236
+	}
237
+
238
+	public function register_meta() {
239
+		global $wp_version;
240
+
241
+		// The enhanced register_meta function is only available for WordPress 4.6+
242
+		if( version_compare( $wp_version, '4.6', '<' ) ) {
243
+			return;
244
+		}
245
+
246
+		// Get all displayed custom fields
247
+		$fields = $this->custom_fields();
248
+
249
+		// Add 'filesize_raw' as this is not included in the displayed field options
250
+		$fields['filesize_raw'] = array(
251
+			'meta_description' => __( 'The raw file size of the podcast episode media file in bytes.', 'seriously-simple-podcasting' ),
252
+		);
255 253
 
256
-    		$args = array(
254
+		foreach( $fields as $key => $data ) {
255
+
256
+			$args = array(
257 257
 				'type' => 'string',
258 258
 				'description' => $data->meta_description,
259 259
 				'single' => true,
260 260
 				'show_in_rest' => true,
261 261
 			);
262 262
 
263
-    		register_meta( 'post', $key, $args );
264
-    	}
263
+			register_meta( 'post', $key, $args );
264
+		}
265 265
 
266
-    }
266
+	}
267 267
 
268
-    /**
268
+	/**
269 269
 	 * Register columns for podcast list table
270 270
 	 * @param  array $defaults Default columns
271 271
 	 * @return array           Modified columns
@@ -282,12 +282,12 @@  discard block
 block discarded – undo
282 282
 		return $columns;
283 283
 	}
284 284
 
285
-    /**
286
-     * Display column data in podcast list table
287
-     * @param  string  $column_name Name of current column
288
-     * @param  integer $id          ID of episode
289
-     * @return void
290
-     */
285
+	/**
286
+	 * Display column data in podcast list table
287
+	 * @param  string  $column_name Name of current column
288
+	 * @param  integer $id          ID of episode
289
+	 * @return void
290
+	 */
291 291
 	public function register_custom_columns( $column_name, $id ) {
292 292
 		global $ss_podcasting;
293 293
 
@@ -317,34 +317,34 @@  discard block
 block discarded – undo
317 317
 	 */
318 318
 	public function edit_series_columns( $columns ) {
319 319
 
320
-        unset( $columns['description'] );
321
-        unset( $columns['posts'] );
320
+		unset( $columns['description'] );
321
+		unset( $columns['posts'] );
322 322
 
323
-        $columns['series_feed_url'] = __( 'Series feed URL' , 'seriously-simple-podcasting' );
324
-        $columns['posts'] = __( 'Episodes' , 'seriously-simple-podcasting' );
323
+		$columns['series_feed_url'] = __( 'Series feed URL' , 'seriously-simple-podcasting' );
324
+		$columns['posts'] = __( 'Episodes' , 'seriously-simple-podcasting' );
325 325
 
326
-        $columns = apply_filters( 'ssp_admin_columns_series', $columns );
326
+		$columns = apply_filters( 'ssp_admin_columns_series', $columns );
327 327
 
328
-        return $columns;
329
-    }
328
+		return $columns;
329
+	}
330 330
 
331
-    /**
332
-     * Display column data in series list table
333
-     *
334
-     * @param string  $column_data Default column content
335
-     * @param string  $column_name Name of current column
336
-     * @param integer $term_id     ID of term
337
-     *
338
-     * @return string
339
-     */
340
-    public function add_series_columns( $column_data , $column_name , $term_id ) {
331
+	/**
332
+	 * Display column data in series list table
333
+	 *
334
+	 * @param string  $column_data Default column content
335
+	 * @param string  $column_name Name of current column
336
+	 * @param integer $term_id     ID of term
337
+	 *
338
+	 * @return string
339
+	 */
340
+	public function add_series_columns( $column_data , $column_name , $term_id ) {
341 341
 
342
-        switch ( $column_name ) {
343
-            case 'series_feed_url':
344
-            	$series = get_term( $term_id, 'series' );
345
-            	$series_slug = $series->slug;
342
+		switch ( $column_name ) {
343
+			case 'series_feed_url':
344
+				$series = get_term( $term_id, 'series' );
345
+				$series_slug = $series->slug;
346 346
 
347
-            	if ( get_option( 'permalink_structure' ) ) {
347
+				if ( get_option( 'permalink_structure' ) ) {
348 348
 					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
349 349
 					$feed_url = $this->home_url . 'feed/' . $feed_slug . '/' . $series_slug;
350 350
 				} else {
@@ -357,33 +357,33 @@  discard block
 block discarded – undo
357 357
 					);
358 358
 				}
359 359
 
360
-                $column_data = '<a href="' . esc_attr( $feed_url ) . '" target="_blank">' . esc_html( $feed_url ) . '</a>';
361
-            break;
362
-        }
360
+				$column_data = '<a href="' . esc_attr( $feed_url ) . '" target="_blank">' . esc_html( $feed_url ) . '</a>';
361
+			break;
362
+		}
363 363
 
364
-        return $column_data;
365
-    }
364
+		return $column_data;
365
+	}
366 366
 
367
-    /**
368
-     * Create custom dashboard message
369
-     * @param  array $messages Default messages
370
-     * @return array           Modified messages
371
-     */
367
+	/**
368
+	 * Create custom dashboard message
369
+	 * @param  array $messages Default messages
370
+	 * @return array           Modified messages
371
+	 */
372 372
 	public function updated_messages( $messages ) {
373 373
 	  global $post, $post_ID;
374 374
 
375 375
 	  $messages[ $this->token ] = array(
376
-	    0 => '',
377
-	    1 => sprintf( __( 'Episode updated. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
378
-	    2 => __( 'Custom field updated.' , 'seriously-simple-podcasting' ),
379
-	    3 => __( 'Custom field deleted.' , 'seriously-simple-podcasting' ),
380
-	    4 => __( 'Episode updated.' , 'seriously-simple-podcasting' ),
381
-	    5 => isset($_GET['revision']) ? sprintf( __( 'Episode restored to revision from %s.' , 'seriously-simple-podcasting' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
382
-	    6 => sprintf( __( 'Episode published. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
383
-	    7 => __( 'Episode saved.' , 'seriously-simple-podcasting' ),
384
-	    8 => sprintf( __( 'Episode submitted. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
385
-	    9 => sprintf( __( 'Episode scheduled for: %1$s. %2$sPreview episode%3$s.' , 'seriously-simple-podcasting' ), '<strong>' . date_i18n( __( 'M j, Y @ G:i' , 'seriously-simple-podcasting' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
386
-	    10 => sprintf( __( 'Episode draft updated. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
376
+		0 => '',
377
+		1 => sprintf( __( 'Episode updated. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
378
+		2 => __( 'Custom field updated.' , 'seriously-simple-podcasting' ),
379
+		3 => __( 'Custom field deleted.' , 'seriously-simple-podcasting' ),
380
+		4 => __( 'Episode updated.' , 'seriously-simple-podcasting' ),
381
+		5 => isset($_GET['revision']) ? sprintf( __( 'Episode restored to revision from %s.' , 'seriously-simple-podcasting' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
382
+		6 => sprintf( __( 'Episode published. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
383
+		7 => __( 'Episode saved.' , 'seriously-simple-podcasting' ),
384
+		8 => sprintf( __( 'Episode submitted. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
385
+		9 => sprintf( __( 'Episode scheduled for: %1$s. %2$sPreview episode%3$s.' , 'seriously-simple-podcasting' ), '<strong>' . date_i18n( __( 'M j, Y @ G:i' , 'seriously-simple-podcasting' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
386
+		10 => sprintf( __( 'Episode draft updated. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
387 387
 	  );
388 388
 
389 389
 	  return $messages;
@@ -651,67 +651,67 @@  discard block
 block discarded – undo
651 651
 
652 652
 		$fields['episode_type'] = array(
653 653
 			'name' => __( 'Episode type:' , 'seriously-simple-podcasting' ),
654
-		    'description' => '',
655
-		    'type' => 'radio',
656
-		    'default' => 'audio',
657
-		    'options' => array( 'audio' => __( 'Audio', 'seriously-simple-podcasting' ), 'video' => __( 'Video', 'seriously-simple-podcasting' ) ),
658
-		    'section' => 'info',
659
-		    'meta_description' => __( 'The type of podcast episode - either Audio or Video', 'seriously-simple-podcasting' ),
654
+			'description' => '',
655
+			'type' => 'radio',
656
+			'default' => 'audio',
657
+			'options' => array( 'audio' => __( 'Audio', 'seriously-simple-podcasting' ), 'video' => __( 'Video', 'seriously-simple-podcasting' ) ),
658
+			'section' => 'info',
659
+			'meta_description' => __( 'The type of podcast episode - either Audio or Video', 'seriously-simple-podcasting' ),
660 660
 		);
661 661
 
662 662
 		// In v1.14+ the `audio_file` field can actually be either audio or video, but we're keeping the field name here for backwards compatibility
663 663
 		$fields['audio_file'] = array(
664
-		    'name' => __( 'Podcast file:' , 'seriously-simple-podcasting' ),
665
-		    'description' => __( 'Upload the primary podcast file or paste the file URL here.' , 'seriously-simple-podcasting' ),
666
-		    'type' => 'file',
667
-		    'default' => '',
668
-		    'section' => 'info',
669
-		    'meta_description' => __( 'The full URL for the podcast episode media file.', 'seriously-simple-podcasting' ),
664
+			'name' => __( 'Podcast file:' , 'seriously-simple-podcasting' ),
665
+			'description' => __( 'Upload the primary podcast file or paste the file URL here.' , 'seriously-simple-podcasting' ),
666
+			'type' => 'file',
667
+			'default' => '',
668
+			'section' => 'info',
669
+			'meta_description' => __( 'The full URL for the podcast episode media file.', 'seriously-simple-podcasting' ),
670 670
 		);
671 671
 
672 672
 		$fields['duration'] = array(
673
-		    'name' => __( 'Duration:' , 'seriously-simple-podcasting' ),
674
-		    'description' => __( 'Duration of podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
675
-		    'type' => 'text',
676
-		    'default' => '',
677
-		    'section' => 'info',
678
-		    'meta_description' => __( 'The duration of the file for display purposes.', 'seriously-simple-podcasting' ),
673
+			'name' => __( 'Duration:' , 'seriously-simple-podcasting' ),
674
+			'description' => __( 'Duration of podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
675
+			'type' => 'text',
676
+			'default' => '',
677
+			'section' => 'info',
678
+			'meta_description' => __( 'The duration of the file for display purposes.', 'seriously-simple-podcasting' ),
679 679
 		);
680 680
 
681 681
 		$fields['filesize'] = array(
682
-		    'name' => __( 'File size:' , 'seriously-simple-podcasting' ),
683
-		    'description' => __( 'Size of the podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
684
-		    'type' => 'text',
685
-		    'default' => '',
686
-		    'section' => 'info',
687
-		    'meta_description' => __( 'The size of the podcast episode for display purposes.', 'seriously-simple-podcasting' ),
682
+			'name' => __( 'File size:' , 'seriously-simple-podcasting' ),
683
+			'description' => __( 'Size of the podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
684
+			'type' => 'text',
685
+			'default' => '',
686
+			'section' => 'info',
687
+			'meta_description' => __( 'The size of the podcast episode for display purposes.', 'seriously-simple-podcasting' ),
688 688
 		);
689 689
 
690 690
 		$fields['date_recorded'] = array(
691
-		    'name' => __( 'Date recorded:' , 'seriously-simple-podcasting' ),
692
-		    'description' => __( 'The date on which this episode was recorded.' , 'seriously-simple-podcasting' ),
693
-		    'type' => 'datepicker',
694
-		    'default' => '',
695
-		    'section' => 'info',
696
-		    'meta_description' => __( 'The date on which the podcast episode was recorded.', 'seriously-simple-podcasting' ),
691
+			'name' => __( 'Date recorded:' , 'seriously-simple-podcasting' ),
692
+			'description' => __( 'The date on which this episode was recorded.' , 'seriously-simple-podcasting' ),
693
+			'type' => 'datepicker',
694
+			'default' => '',
695
+			'section' => 'info',
696
+			'meta_description' => __( 'The date on which the podcast episode was recorded.', 'seriously-simple-podcasting' ),
697 697
 		);
698 698
 
699 699
 		$fields['explicit'] = array(
700
-		    'name' => __( 'Explicit:' , 'seriously-simple-podcasting' ),
701
-		    'description' => __( 'Mark this episode as explicit.' , 'seriously-simple-podcasting' ),
702
-		    'type' => 'checkbox',
703
-		    'default' => '',
704
-		    'section' => 'info',
705
-		    'meta_description' => __( 'Indicates whether the episode is explicit or not.', 'seriously-simple-podcasting' ),
700
+			'name' => __( 'Explicit:' , 'seriously-simple-podcasting' ),
701
+			'description' => __( 'Mark this episode as explicit.' , 'seriously-simple-podcasting' ),
702
+			'type' => 'checkbox',
703
+			'default' => '',
704
+			'section' => 'info',
705
+			'meta_description' => __( 'Indicates whether the episode is explicit or not.', 'seriously-simple-podcasting' ),
706 706
 		);
707 707
 
708 708
 		$fields['block'] = array(
709
-		    'name' => __( 'Block:' , 'seriously-simple-podcasting' ),
710
-		    'description' => __( 'Block this episode from appearing in the iTunes & Google Play podcast libraries.' , 'seriously-simple-podcasting' ),
711
-		    'type' => 'checkbox',
712
-		    'default' => '',
713
-		    'section' => 'info',
714
-		    'meta_description' => __( 'Indicates whether this specific episode should be blocked from the iTunes and Google Play Podcast libraries.', 'seriously-simple-podcasting' ),
709
+			'name' => __( 'Block:' , 'seriously-simple-podcasting' ),
710
+			'description' => __( 'Block this episode from appearing in the iTunes & Google Play podcast libraries.' , 'seriously-simple-podcasting' ),
711
+			'type' => 'checkbox',
712
+			'default' => '',
713
+			'section' => 'info',
714
+			'meta_description' => __( 'Indicates whether this specific episode should be blocked from the iTunes and Google Play Podcast libraries.', 'seriously-simple-podcasting' ),
715 715
 		);
716 716
 
717 717
 		return apply_filters( 'ssp_episode_fields', $fields );
@@ -817,20 +817,20 @@  discard block
 block discarded – undo
817 817
 	 * @return void
818 818
 	 */
819 819
 	public function load_plugin_textdomain() {
820
-	    $domain = 'seriously-simple-podcasting';
821
-	    // The "plugin_locale" filter is also used in load_plugin_textdomain()
822
-	    $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
820
+		$domain = 'seriously-simple-podcasting';
821
+		// The "plugin_locale" filter is also used in load_plugin_textdomain()
822
+		$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
823 823
 
824
-	    load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
825
-	    load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
824
+		load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
825
+		load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
826 826
 	}
827 827
 
828
-    /**
829
-     * Register podcast feed
830
-     * @return void
831
-     */
832
-    public function add_feed() {
833
-    	$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
828
+	/**
829
+	 * Register podcast feed
830
+	 * @return void
831
+	 */
832
+	public function add_feed() {
833
+		$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
834 834
 		add_feed( $feed_slug, array( $this, 'feed_template' ) );
835 835
 	}
836 836
 
@@ -852,31 +852,31 @@  discard block
 block discarded – undo
852 852
 	 * Load feed template
853 853
 	 * @return void
854 854
 	 */
855
-    public function feed_template() {
856
-    	global $wp_query;
855
+	public function feed_template() {
856
+		global $wp_query;
857 857
 
858
-    	// Prevent 404 on feed
859
-    	$wp_query->is_404 = false;
860
-    	status_header( 200 );
858
+		// Prevent 404 on feed
859
+		$wp_query->is_404 = false;
860
+		status_header( 200 );
861 861
 
862
-    	$file_name = 'feed-podcast.php';
862
+		$file_name = 'feed-podcast.php';
863 863
 
864
-    	$user_template_file = apply_filters( 'ssp_feed_template_file', trailingslashit( get_stylesheet_directory() ) . $file_name );
864
+		$user_template_file = apply_filters( 'ssp_feed_template_file', trailingslashit( get_stylesheet_directory() ) . $file_name );
865 865
 
866 866
 		// Any functions hooked in here must NOT output any data or else feed will break
867 867
 		do_action( 'ssp_before_feed' );
868 868
 
869
-    	// Load user feed template if it exists, otherwise use plugin template
870
-    	if ( file_exists( $user_template_file ) ) {
871
-    		require( $user_template_file );
872
-    	} else {
873
-    		require( $this->template_path . $file_name );
874
-    	}
869
+		// Load user feed template if it exists, otherwise use plugin template
870
+		if ( file_exists( $user_template_file ) ) {
871
+			require( $user_template_file );
872
+		} else {
873
+			require( $this->template_path . $file_name );
874
+		}
875 875
 
876
-    	// Any functions hooked in here must NOT output any data or else feed will break
877
-    	do_action( 'ssp_after_feed' );
876
+		// Any functions hooked in here must NOT output any data or else feed will break
877
+		do_action( 'ssp_after_feed' );
878 878
 
879
-    	exit;
879
+		exit;
880 880
 	}
881 881
 
882 882
 	/**
Please login to merge, or discard this patch.
Spacing   +286 added lines, -286 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
 
@@ -32,84 +32,84 @@  discard block
 block discarded – undo
32 32
 
33 33
 		$this->version = $version;
34 34
 
35
-		$this->dir = dirname( $file );
35
+		$this->dir = dirname ( $file );
36 36
 		$this->file = $file;
37
-		$this->assets_dir = trailingslashit( $this->dir ) . 'assets';
38
-		$this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $file ) ) );
39
-		$this->template_path = trailingslashit( $this->dir ) . 'templates/';
40
-		$this->home_url = trailingslashit( home_url() );
37
+		$this->assets_dir = trailingslashit ( $this->dir ).'assets';
38
+		$this->assets_url = esc_url ( trailingslashit ( plugins_url ( '/assets/', $file ) ) );
39
+		$this->template_path = trailingslashit ( $this->dir ).'templates/';
40
+		$this->home_url = trailingslashit ( home_url () );
41 41
 		$this->token = 'podcast';
42 42
 
43
-		$this->script_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
43
+		$this->script_suffix = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
44 44
 
45 45
 		// Handle localisation
46
-		$this->load_plugin_textdomain();
47
-		add_action( 'init', array( $this, 'load_localisation' ), 0 );
46
+		$this->load_plugin_textdomain ();
47
+		add_action ( 'init', array( $this, 'load_localisation' ), 0 );
48 48
 
49 49
 		// Regsiter podcast post type, taxonomies and meta fields
50
-		add_action( 'init', array( $this, 'register_post_type' ), 1 );
50
+		add_action ( 'init', array( $this, 'register_post_type' ), 1 );
51 51
 
52 52
 		// Register podcast feed
53
-		add_action( 'init', array( $this, 'add_feed' ), 1 );
53
+		add_action ( 'init', array( $this, 'add_feed' ), 1 );
54 54
 
55 55
 		// Hide WP SEO footer text for podcast RSS feed
56
-		add_filter( 'wpseo_include_rss_footer', array( $this, 'hide_wp_seo_rss_footer' ) );
56
+		add_filter ( 'wpseo_include_rss_footer', array( $this, 'hide_wp_seo_rss_footer' ) );
57 57
 
58 58
 		// Handle v1.x feed URL as well as feed URLs for default permalinks
59
-		add_action( 'init', array( $this, 'redirect_old_feed' ) );
59
+		add_action ( 'init', array( $this, 'redirect_old_feed' ) );
60 60
 
61 61
 		// Setup custom permalink structures
62
-		add_action( 'init', array( $this, 'setup_permastruct' ), 10 );
62
+		add_action ( 'init', array( $this, 'setup_permastruct' ), 10 );
63 63
 
64
-		if ( is_admin() ) {
64
+		if ( is_admin () ) {
65 65
 
66
-			add_action( 'admin_init', array( $this, 'update_enclosures' ) );
66
+			add_action ( 'admin_init', array( $this, 'update_enclosures' ) );
67 67
 
68 68
 			// Episode meta box
69
-			add_action( 'admin_init', array( $this, 'register_meta_boxes' ) );
70
-			add_action( 'save_post', array( $this, 'meta_box_save' ), 10, 1 );
69
+			add_action ( 'admin_init', array( $this, 'register_meta_boxes' ) );
70
+			add_action ( 'save_post', array( $this, 'meta_box_save' ), 10, 1 );
71 71
 
72 72
 			// Episode edit screen
73
-			add_filter( 'enter_title_here', array( $this, 'enter_title_here' ) );
74
-			add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
73
+			add_filter ( 'enter_title_here', array( $this, 'enter_title_here' ) );
74
+			add_filter ( 'post_updated_messages', array( $this, 'updated_messages' ) );
75 75
 
76 76
 			// Admin JS & CSS
77
-			add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ), 10 );
78
-			add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 10 );
77
+			add_action ( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ), 10 );
78
+			add_action ( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 10 );
79 79
 
80 80
 			// Episodes list table
81
-			add_filter( 'manage_edit-' . $this->token . '_columns', array( $this, 'register_custom_column_headings' ), 10, 1 );
82
-			add_action( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 );
81
+			add_filter ( 'manage_edit-'.$this->token.'_columns', array( $this, 'register_custom_column_headings' ), 10, 1 );
82
+			add_action ( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 );
83 83
 
84 84
 			// Series list table
85
-			add_filter( 'manage_edit-series_columns' , array( $this, 'edit_series_columns' ) );
86
-            add_filter( 'manage_series_custom_column' , array( $this, 'add_series_columns' ), 1, 3 );
85
+			add_filter ( 'manage_edit-series_columns', array( $this, 'edit_series_columns' ) );
86
+            add_filter ( 'manage_series_custom_column', array( $this, 'add_series_columns' ), 1, 3 );
87 87
 
88 88
             // Dashboard widgets
89
-            add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
89
+            add_filter ( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
90 90
 
91 91
             // Appreciation links
92
-            add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
92
+            add_filter ( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
93 93
 
94 94
             // Add footer text to dashboard
95
-            add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
95
+            add_filter ( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
96 96
 
97 97
             // Clear the cache on post save.
98
-            add_action( 'save_post', array( $this, 'invalidate_cache' ), 10, 2 );
98
+            add_action ( 'save_post', array( $this, 'invalidate_cache' ), 10, 2 );
99 99
 
100 100
 		}
101 101
 
102 102
 		// Add ajax action for plugin rating
103
-		add_action( 'wp_ajax_ssp_rated', array( $this, 'rated' ) );
103
+		add_action ( 'wp_ajax_ssp_rated', array( $this, 'rated' ) );
104 104
 
105 105
 		// Add ajax action for customising episode embed code
106
-		add_action( 'wp_ajax_update_episode_embed_code', array( $this, 'update_episode_embed_code' ) );
106
+		add_action ( 'wp_ajax_update_episode_embed_code', array( $this, 'update_episode_embed_code' ) );
107 107
 
108 108
 		// Setup activation and deactivation hooks
109
-		register_activation_hook( $file, array( $this, 'activate' ) );
110
-		register_deactivation_hook( $file, array( $this, 'deactivate' ) );
109
+		register_activation_hook ( $file, array( $this, 'activate' ) );
110
+		register_deactivation_hook ( $file, array( $this, 'deactivate' ) );
111 111
 
112
-		add_action( 'init', array( $this, 'update' ), 11 );
112
+		add_action ( 'init', array( $this, 'update' ), 11 );
113 113
 	}
114 114
 
115 115
 	/**
@@ -119,17 +119,17 @@  discard block
 block discarded – undo
119 119
 	public function setup_permastruct() {
120 120
 
121 121
 		// Episode download & player URLs
122
-		add_rewrite_rule( '^podcast-download/([^/]*)/([^/]*)/?', 'index.php?podcast_episode=$matches[1]', 'top' );
123
-		add_rewrite_rule( '^podcast-player/([^/]*)/([^/]*)/?', 'index.php?podcast_episode=$matches[1]&podcast_ref=player', 'top' );
122
+		add_rewrite_rule ( '^podcast-download/([^/]*)/([^/]*)/?', 'index.php?podcast_episode=$matches[1]', 'top' );
123
+		add_rewrite_rule ( '^podcast-player/([^/]*)/([^/]*)/?', 'index.php?podcast_episode=$matches[1]&podcast_ref=player', 'top' );
124 124
 
125 125
 		// Custom query variables
126
-		add_rewrite_tag( '%podcast_episode%', '([^&]+)' );
127
-		add_rewrite_tag( '%podcast_ref%', '([^&]+)' );
126
+		add_rewrite_tag ( '%podcast_episode%', '([^&]+)' );
127
+		add_rewrite_tag ( '%podcast_ref%', '([^&]+)' );
128 128
 
129 129
 		// Series feed URLs
130
-		$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
131
-		add_rewrite_rule( '^feed/' . $feed_slug . '/([^/]*)/?', 'index.php?feed=podcast&podcast_series=$matches[1]', 'top' );
132
-		add_rewrite_tag( '%podcast_series%', '([^&]+)' );
130
+		$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
131
+		add_rewrite_rule ( '^feed/'.$feed_slug.'/([^/]*)/?', 'index.php?feed=podcast&podcast_series=$matches[1]', 'top' );
132
+		add_rewrite_tag ( '%podcast_series%', '([^&]+)' );
133 133
 	}
134 134
 
135 135
 	/**
@@ -139,25 +139,25 @@  discard block
 block discarded – undo
139 139
 	public function register_post_type() {
140 140
 
141 141
 		$labels = array(
142
-			'name' => _x( 'Podcast', 'post type general name' , 'seriously-simple-podcasting' ),
143
-			'singular_name' => _x( 'Podcast', 'post type singular name' , 'seriously-simple-podcasting' ),
144
-			'add_new' => _x( 'Add New', 'podcast' , 'seriously-simple-podcasting' ),
145
-			'add_new_item' => sprintf( __( 'Add New %s' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
146
-			'edit_item' => sprintf( __( 'Edit %s' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
147
-			'new_item' => sprintf( __( 'New %s' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
148
-			'all_items' => sprintf( __( 'All %s' , 'seriously-simple-podcasting' ), __( 'Episodes' , 'seriously-simple-podcasting' ) ),
149
-			'view_item' => sprintf( __( 'View %s' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
150
-			'search_items' => sprintf( __( 'Search %a' , 'seriously-simple-podcasting' ), __( 'Episodes' , 'seriously-simple-podcasting' ) ),
151
-			'not_found' =>  sprintf( __( 'No %s Found' , 'seriously-simple-podcasting' ), __( 'Episodes' , 'seriously-simple-podcasting' ) ),
152
-			'not_found_in_trash' => sprintf( __( 'No %s Found In Trash' , 'seriously-simple-podcasting' ), __( 'Episodes' , 'seriously-simple-podcasting' ) ),
142
+			'name' => _x ( 'Podcast', 'post type general name', 'seriously-simple-podcasting' ),
143
+			'singular_name' => _x ( 'Podcast', 'post type singular name', 'seriously-simple-podcasting' ),
144
+			'add_new' => _x ( 'Add New', 'podcast', 'seriously-simple-podcasting' ),
145
+			'add_new_item' => sprintf ( __ ( 'Add New %s', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
146
+			'edit_item' => sprintf ( __ ( 'Edit %s', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
147
+			'new_item' => sprintf ( __ ( 'New %s', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
148
+			'all_items' => sprintf ( __ ( 'All %s', 'seriously-simple-podcasting' ), __ ( 'Episodes', 'seriously-simple-podcasting' ) ),
149
+			'view_item' => sprintf ( __ ( 'View %s', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
150
+			'search_items' => sprintf ( __ ( 'Search %a', 'seriously-simple-podcasting' ), __ ( 'Episodes', 'seriously-simple-podcasting' ) ),
151
+			'not_found' =>  sprintf ( __ ( 'No %s Found', 'seriously-simple-podcasting' ), __ ( 'Episodes', 'seriously-simple-podcasting' ) ),
152
+			'not_found_in_trash' => sprintf ( __ ( 'No %s Found In Trash', 'seriously-simple-podcasting' ), __ ( 'Episodes', 'seriously-simple-podcasting' ) ),
153 153
 			'parent_item_colon' => '',
154
-			'menu_name' => __( 'Podcast' , 'seriously-simple-podcasting' ),
155
-			'filter_items_list' => sprintf( __( 'Filter %s list' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
156
-			'items_list_navigation' => sprintf( __( '%s list navigation' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
157
-			'items_list' => sprintf( __( '%s list' , 'seriously-simple-podcasting' ), __( 'Episode' , 'seriously-simple-podcasting' ) ),
154
+			'menu_name' => __ ( 'Podcast', 'seriously-simple-podcasting' ),
155
+			'filter_items_list' => sprintf ( __ ( 'Filter %s list', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
156
+			'items_list_navigation' => sprintf ( __ ( '%s list navigation', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
157
+			'items_list' => sprintf ( __ ( '%s list', 'seriously-simple-podcasting' ), __ ( 'Episode', 'seriously-simple-podcasting' ) ),
158 158
 		);
159 159
 
160
-		$slug = apply_filters( 'ssp_archive_slug', __( 'podcast' , 'seriously-simple-podcasting' ) );
160
+		$slug = apply_filters ( 'ssp_archive_slug', __ ( 'podcast', 'seriously-simple-podcasting' ) );
161 161
 
162 162
 		$args = array(
163 163
 			'labels' => $labels,
@@ -179,12 +179,12 @@  discard block
 block discarded – undo
179 179
 			'show_in_rest' => true,
180 180
 		);
181 181
 
182
-		$args = apply_filters( 'ssp_register_post_type_args', $args );
182
+		$args = apply_filters ( 'ssp_register_post_type_args', $args );
183 183
 
184
-		register_post_type( $this->token, $args );
184
+		register_post_type ( $this->token, $args );
185 185
 
186
-		$this->register_taxonomies();
187
-		$this->register_meta();
186
+		$this->register_taxonomies ();
187
+		$this->register_meta ();
188 188
 	}
189 189
 
190 190
 	/**
@@ -193,45 +193,45 @@  discard block
 block discarded – undo
193 193
 	 */
194 194
 	private function register_taxonomies() {
195 195
 
196
-		$podcast_post_types = ssp_post_types( true );
196
+		$podcast_post_types = ssp_post_types ( true );
197 197
 
198 198
         $series_labels = array(
199
-            'name' => __( 'Podcast Series' , 'seriously-simple-podcasting' ),
200
-            'singular_name' => __( 'Series', 'seriously-simple-podcasting' ),
201
-            'search_items' =>  __( 'Search Series' , 'seriously-simple-podcasting' ),
202
-            'all_items' => __( 'All Series' , 'seriously-simple-podcasting' ),
203
-            'parent_item' => __( 'Parent Series' , 'seriously-simple-podcasting' ),
204
-            'parent_item_colon' => __( 'Parent Series:' , 'seriously-simple-podcasting' ),
205
-            'edit_item' => __( 'Edit Series' , 'seriously-simple-podcasting' ),
206
-            'update_item' => __( 'Update Series' , 'seriously-simple-podcasting' ),
207
-            'add_new_item' => __( 'Add New Series' , 'seriously-simple-podcasting' ),
208
-            'new_item_name' => __( 'New Series Name' , 'seriously-simple-podcasting' ),
209
-            'menu_name' => __( 'Series' , 'seriously-simple-podcasting' ),
210
-            'view_item' => __( 'View Series' , 'seriously-simple-podcasting' ),
211
-            'popular_items' => __( 'Popular Series' , 'seriously-simple-podcasting' ),
212
-            'separate_items_with_commas' => __( 'Separate series with commas' , 'seriously-simple-podcasting' ),
213
-            'add_or_remove_items' => __( 'Add or remove Series' , 'seriously-simple-podcasting' ),
214
-            'choose_from_most_used' => __( 'Choose from the most used Series' , 'seriously-simple-podcasting' ),
215
-            'not_found' => __( 'No Series Found' , 'seriously-simple-podcasting' ),
216
-            'items_list_navigation' => __( 'Series list navigation' , 'seriously-simple-podcasting' ),
217
-            'items_list' => __( 'Series list' , 'seriously-simple-podcasting' ),
199
+            'name' => __ ( 'Podcast Series', 'seriously-simple-podcasting' ),
200
+            'singular_name' => __ ( 'Series', 'seriously-simple-podcasting' ),
201
+            'search_items' =>  __ ( 'Search Series', 'seriously-simple-podcasting' ),
202
+            'all_items' => __ ( 'All Series', 'seriously-simple-podcasting' ),
203
+            'parent_item' => __ ( 'Parent Series', 'seriously-simple-podcasting' ),
204
+            'parent_item_colon' => __ ( 'Parent Series:', 'seriously-simple-podcasting' ),
205
+            'edit_item' => __ ( 'Edit Series', 'seriously-simple-podcasting' ),
206
+            'update_item' => __ ( 'Update Series', 'seriously-simple-podcasting' ),
207
+            'add_new_item' => __ ( 'Add New Series', 'seriously-simple-podcasting' ),
208
+            'new_item_name' => __ ( 'New Series Name', 'seriously-simple-podcasting' ),
209
+            'menu_name' => __ ( 'Series', 'seriously-simple-podcasting' ),
210
+            'view_item' => __ ( 'View Series', 'seriously-simple-podcasting' ),
211
+            'popular_items' => __ ( 'Popular Series', 'seriously-simple-podcasting' ),
212
+            'separate_items_with_commas' => __ ( 'Separate series with commas', 'seriously-simple-podcasting' ),
213
+            'add_or_remove_items' => __ ( 'Add or remove Series', 'seriously-simple-podcasting' ),
214
+            'choose_from_most_used' => __ ( 'Choose from the most used Series', 'seriously-simple-podcasting' ),
215
+            'not_found' => __ ( 'No Series Found', 'seriously-simple-podcasting' ),
216
+            'items_list_navigation' => __ ( 'Series list navigation', 'seriously-simple-podcasting' ),
217
+            'items_list' => __ ( 'Series list', 'seriously-simple-podcasting' ),
218 218
         );
219 219
 
220 220
         $series_args = array(
221 221
             'public' => true,
222 222
             'hierarchical' => true,
223
-            'rewrite' => array( 'slug' => apply_filters( 'ssp_series_slug', 'series' ) ),
223
+            'rewrite' => array( 'slug' => apply_filters ( 'ssp_series_slug', 'series' ) ),
224 224
             'labels' => $series_labels,
225 225
             'show_in_rest' => true,
226 226
         );
227 227
 
228
-        $series_args = apply_filters( 'ssp_register_taxonomy_args', $series_args, 'series' );
228
+        $series_args = apply_filters ( 'ssp_register_taxonomy_args', $series_args, 'series' );
229 229
 
230
-        register_taxonomy( 'series', $podcast_post_types, $series_args );
230
+        register_taxonomy ( 'series', $podcast_post_types, $series_args );
231 231
 
232 232
         // Add Tags to podcast post type
233
-        if ( apply_filters( 'ssp_use_post_tags', true ) ) {
234
-        	register_taxonomy_for_object_type( 'post_tag', $this->token );
233
+        if ( apply_filters ( 'ssp_use_post_tags', true ) ) {
234
+        	register_taxonomy_for_object_type ( 'post_tag', $this->token );
235 235
         }
236 236
     }
237 237
 
@@ -239,28 +239,28 @@  discard block
 block discarded – undo
239 239
     	global $wp_version;
240 240
 
241 241
     	// The enhanced register_meta function is only available for WordPress 4.6+
242
-    	if( version_compare( $wp_version, '4.6', '<' ) ) {
242
+    	if ( version_compare ( $wp_version, '4.6', '<' ) ) {
243 243
     		return;
244 244
     	}
245 245
 
246 246
     	// Get all displayed custom fields
247
-    	$fields = $this->custom_fields();
247
+    	$fields = $this->custom_fields ();
248 248
 
249 249
     	// Add 'filesize_raw' as this is not included in the displayed field options
250
-    	$fields['filesize_raw'] = array(
251
-    		'meta_description' => __( 'The raw file size of the podcast episode media file in bytes.', 'seriously-simple-podcasting' ),
250
+    	$fields[ 'filesize_raw' ] = array(
251
+    		'meta_description' => __ ( 'The raw file size of the podcast episode media file in bytes.', 'seriously-simple-podcasting' ),
252 252
 		);
253 253
 
254
-    	foreach( $fields as $key => $data ) {
254
+    	foreach ( $fields as $key => $data ) {
255 255
 
256 256
     		$args = array(
257 257
 				'type' => 'string',
258
-				'description' => $data['meta_description'],
258
+				'description' => $data[ 'meta_description' ],
259 259
 				'single' => true,
260 260
 				'show_in_rest' => true,
261 261
 			);
262 262
 
263
-    		register_meta( 'post', $key, $args );
263
+    		register_meta ( 'post', $key, $args );
264 264
     	}
265 265
 
266 266
     }
@@ -271,13 +271,13 @@  discard block
 block discarded – undo
271 271
 	 * @return array           Modified columns
272 272
 	 */
273 273
 	public function register_custom_column_headings( $defaults ) {
274
-		$new_columns = apply_filters( 'ssp_admin_columns_episodes', array( 'series' => __( 'Series' , 'seriously-simple-podcasting' ) , 'image' => __( 'Image' , 'seriously-simple-podcasting' ) ) );
274
+		$new_columns = apply_filters ( 'ssp_admin_columns_episodes', array( 'series' => __ ( 'Series', 'seriously-simple-podcasting' ), 'image' => __ ( 'Image', 'seriously-simple-podcasting' ) ) );
275 275
 
276 276
 		// remove date column
277
-		unset( $defaults['date'] );
277
+		unset( $defaults[ 'date' ] );
278 278
 
279 279
 		// add new columns before last default one
280
-		$columns = array_slice( $defaults, 0, -1 ) + $new_columns + array_slice( $defaults, -1 );
280
+		$columns = array_slice ( $defaults, 0, -1 ) + $new_columns + array_slice ( $defaults, -1 );
281 281
 
282 282
 		return $columns;
283 283
 	}
@@ -294,13 +294,13 @@  discard block
 block discarded – undo
294 294
 		switch ( $column_name ) {
295 295
 
296 296
 			case 'series':
297
-				$terms = wp_get_post_terms( $id , 'series' );
298
-				$term_names = wp_list_pluck( $terms, 'name' );
299
-				echo join( ', ', $term_names );
297
+				$terms = wp_get_post_terms ( $id, 'series' );
298
+				$term_names = wp_list_pluck ( $terms, 'name' );
299
+				echo join ( ', ', $term_names );
300 300
 			break;
301 301
 
302 302
 			case 'image':
303
-				$value = $ss_podcasting->get_image( $id, 40 );
303
+				$value = $ss_podcasting->get_image ( $id, 40 );
304 304
 				echo $value;
305 305
 			break;
306 306
 
@@ -317,13 +317,13 @@  discard block
 block discarded – undo
317 317
 	 */
318 318
 	public function edit_series_columns( $columns ) {
319 319
 
320
-        unset( $columns['description'] );
321
-        unset( $columns['posts'] );
320
+        unset( $columns[ 'description' ] );
321
+        unset( $columns[ 'posts' ] );
322 322
 
323
-        $columns['series_feed_url'] = __( 'Series feed URL' , 'seriously-simple-podcasting' );
324
-        $columns['posts'] = __( 'Episodes' , 'seriously-simple-podcasting' );
323
+        $columns[ 'series_feed_url' ] = __ ( 'Series feed URL', 'seriously-simple-podcasting' );
324
+        $columns[ 'posts' ] = __ ( 'Episodes', 'seriously-simple-podcasting' );
325 325
 
326
-        $columns = apply_filters( 'ssp_admin_columns_series', $columns );
326
+        $columns = apply_filters ( 'ssp_admin_columns_series', $columns );
327 327
 
328 328
         return $columns;
329 329
     }
@@ -337,18 +337,18 @@  discard block
 block discarded – undo
337 337
      *
338 338
      * @return string
339 339
      */
340
-    public function add_series_columns( $column_data , $column_name , $term_id ) {
340
+    public function add_series_columns( $column_data, $column_name, $term_id ) {
341 341
 
342 342
         switch ( $column_name ) {
343 343
             case 'series_feed_url':
344
-            	$series = get_term( $term_id, 'series' );
344
+            	$series = get_term ( $term_id, 'series' );
345 345
             	$series_slug = $series->slug;
346 346
 
347
-            	if ( get_option( 'permalink_structure' ) ) {
348
-					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
349
-					$feed_url = $this->home_url . 'feed/' . $feed_slug . '/' . $series_slug;
347
+            	if ( get_option ( 'permalink_structure' ) ) {
348
+					$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
349
+					$feed_url = $this->home_url.'feed/'.$feed_slug.'/'.$series_slug;
350 350
 				} else {
351
-					$feed_url = add_query_arg(
351
+					$feed_url = add_query_arg (
352 352
 						array(
353 353
 							'feed' => $this->token,
354 354
 							'podcast_series' => $series_slug
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 					);
358 358
 				}
359 359
 
360
-                $column_data = '<a href="' . esc_attr( $feed_url ) . '" target="_blank">' . esc_html( $feed_url ) . '</a>';
360
+                $column_data = '<a href="'.esc_attr ( $feed_url ).'" target="_blank">'.esc_html ( $feed_url ).'</a>';
361 361
             break;
362 362
         }
363 363
 
@@ -374,16 +374,16 @@  discard block
 block discarded – undo
374 374
 
375 375
 	  $messages[ $this->token ] = array(
376 376
 	    0 => '',
377
-	    1 => sprintf( __( 'Episode updated. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
378
-	    2 => __( 'Custom field updated.' , 'seriously-simple-podcasting' ),
379
-	    3 => __( 'Custom field deleted.' , 'seriously-simple-podcasting' ),
380
-	    4 => __( 'Episode updated.' , 'seriously-simple-podcasting' ),
381
-	    5 => isset($_GET['revision']) ? sprintf( __( 'Episode restored to revision from %s.' , 'seriously-simple-podcasting' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
382
-	    6 => sprintf( __( 'Episode published. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
383
-	    7 => __( 'Episode saved.' , 'seriously-simple-podcasting' ),
384
-	    8 => sprintf( __( 'Episode submitted. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
385
-	    9 => sprintf( __( 'Episode scheduled for: %1$s. %2$sPreview episode%3$s.' , 'seriously-simple-podcasting' ), '<strong>' . date_i18n( __( 'M j, Y @ G:i' , 'seriously-simple-podcasting' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
386
-	    10 => sprintf( __( 'Episode draft updated. %sPreview episode%s.' , 'seriously-simple-podcasting' ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
377
+	    1 => sprintf ( __ ( 'Episode updated. %sView episode%s.', 'seriously-simple-podcasting' ), '<a href="'.esc_url ( get_permalink ( $post_ID ) ).'">', '</a>' ),
378
+	    2 => __ ( 'Custom field updated.', 'seriously-simple-podcasting' ),
379
+	    3 => __ ( 'Custom field deleted.', 'seriously-simple-podcasting' ),
380
+	    4 => __ ( 'Episode updated.', 'seriously-simple-podcasting' ),
381
+	    5 => isset( $_GET[ 'revision' ] ) ? sprintf ( __ ( 'Episode restored to revision from %s.', 'seriously-simple-podcasting' ), wp_post_revision_title ( (int) $_GET[ 'revision' ], false ) ) : false,
382
+	    6 => sprintf ( __ ( 'Episode published. %sView episode%s.', 'seriously-simple-podcasting' ), '<a href="'.esc_url ( get_permalink ( $post_ID ) ).'">', '</a>' ),
383
+	    7 => __ ( 'Episode saved.', 'seriously-simple-podcasting' ),
384
+	    8 => sprintf ( __ ( 'Episode submitted. %sPreview episode%s.', 'seriously-simple-podcasting' ), '<a target="_blank" href="'.esc_url ( add_query_arg ( 'preview', 'true', get_permalink ( $post_ID ) ) ).'">', '</a>' ),
385
+	    9 => sprintf ( __ ( 'Episode scheduled for: %1$s. %2$sPreview episode%3$s.', 'seriously-simple-podcasting' ), '<strong>'.date_i18n ( __ ( 'M j, Y @ G:i', 'seriously-simple-podcasting' ), strtotime ( $post->post_date ) ).'</strong>', '<a target="_blank" href="'.esc_url ( get_permalink ( $post_ID ) ).'">', '</a>' ),
386
+	    10 => sprintf ( __ ( 'Episode draft updated. %sPreview episode%s.', 'seriously-simple-podcasting' ), '<a target="_blank" href="'.esc_url ( add_query_arg ( 'preview', 'true', get_permalink ( $post_ID ) ) ).'">', '</a>' ),
387 387
 	  );
388 388
 
389 389
 	  return $messages;
@@ -393,14 +393,14 @@  discard block
 block discarded – undo
393 393
 	 * Register podcast episode details meta boxes
394 394
 	 * @return void
395 395
 	 */
396
-	public function register_meta_boxes () {
396
+	public function register_meta_boxes() {
397 397
 
398 398
 		// Get all podcast post types
399
-		$podcast_post_types = ssp_post_types( true );
399
+		$podcast_post_types = ssp_post_types ( true );
400 400
 
401 401
 		// Add meta box to each post type
402 402
 		foreach ( (array) $podcast_post_types as $post_type ) {
403
-			add_action( 'add_meta_boxes_' . $post_type, array( $this, 'meta_box_setup' ), 10, 1 );
403
+			add_action ( 'add_meta_boxes_'.$post_type, array( $this, 'meta_box_setup' ), 10, 1 );
404 404
 		}
405 405
 	}
406 406
 
@@ -408,17 +408,17 @@  discard block
 block discarded – undo
408 408
 	 * Create meta box on episode edit screen
409 409
 	 * @return void
410 410
 	 */
411
-	public function meta_box_setup ( $post ) {
411
+	public function meta_box_setup( $post ) {
412 412
 		global $pagenow;
413 413
 
414
-		add_meta_box( 'podcast-episode-data', __( 'Podcast Episode Details' , 'seriously-simple-podcasting' ), array( $this, 'meta_box_content' ), $post->post_type, 'normal', 'high' );
414
+		add_meta_box ( 'podcast-episode-data', __ ( 'Podcast Episode Details', 'seriously-simple-podcasting' ), array( $this, 'meta_box_content' ), $post->post_type, 'normal', 'high' );
415 415
 
416
-		if( 'post.php' == $pagenow && 'publish' == $post->post_status && function_exists( 'get_post_embed_html' ) ) {
417
-			add_meta_box( 'episode-embed-code', __( 'Episode Embed Code' , 'seriously-simple-podcasting' ), array( $this, 'embed_code_meta_box_content' ), $post->post_type, 'side', 'low' );
416
+		if ( 'post.php' == $pagenow && 'publish' == $post->post_status && function_exists ( 'get_post_embed_html' ) ) {
417
+			add_meta_box ( 'episode-embed-code', __ ( 'Episode Embed Code', 'seriously-simple-podcasting' ), array( $this, 'embed_code_meta_box_content' ), $post->post_type, 'side', 'low' );
418 418
 		}
419 419
 
420 420
 		// Allow more metaboxes to be added
421
-		do_action( 'ssp_meta_boxes', $post );
421
+		do_action ( 'ssp_meta_boxes', $post );
422 422
 
423 423
 	}
424 424
 
@@ -427,15 +427,15 @@  discard block
 block discarded – undo
427 427
 	 * @param  object $post Current post object
428 428
 	 * @return void
429 429
 	 */
430
-	public function embed_code_meta_box_content ( $post ) {
430
+	public function embed_code_meta_box_content( $post ) {
431 431
 
432 432
 		// Get post embed code
433
-		$embed_code = get_post_embed_html( 500, 350, $post );
433
+		$embed_code = get_post_embed_html ( 500, 350, $post );
434 434
 
435 435
 		// Generate markup for meta box
436
-		$html = '<p><em>' . __( 'Customise the size of your episode embed below, then copy the HTML to your clipboard.', 'seriously-simple-podcasting' ) . '</em></p>';
437
-		$html .= '<p><label for="episode_embed_code_width">' . __( 'Width:', 'seriously-simple-podcasting' ) . '</label> <input id="episode_embed_code_width" class="episode_embed_code_size_option" type="number" value="500" length="3" min="0" step="1" /> &nbsp;&nbsp;&nbsp;&nbsp;<label for="episode_embed_code_height">' . __( 'Height:', 'seriously-simple-podcasting' ) . '</label> <input id="episode_embed_code_height" class="episode_embed_code_size_option" type="number" value="350" length="3" min="0" step="1" /></p>';
438
-		$html .= '<p><textarea readonly id="episode_embed_code">' . esc_textarea( $embed_code ) . '</textarea></p>';
436
+		$html = '<p><em>'.__ ( 'Customise the size of your episode embed below, then copy the HTML to your clipboard.', 'seriously-simple-podcasting' ).'</em></p>';
437
+		$html .= '<p><label for="episode_embed_code_width">'.__ ( 'Width:', 'seriously-simple-podcasting' ).'</label> <input id="episode_embed_code_width" class="episode_embed_code_size_option" type="number" value="500" length="3" min="0" step="1" /> &nbsp;&nbsp;&nbsp;&nbsp;<label for="episode_embed_code_height">'.__ ( 'Height:', 'seriously-simple-podcasting' ).'</label> <input id="episode_embed_code_height" class="episode_embed_code_size_option" type="number" value="350" length="3" min="0" step="1" /></p>';
438
+		$html .= '<p><textarea readonly id="episode_embed_code">'.esc_textarea ( $embed_code ).'</textarea></p>';
439 439
 
440 440
 		echo $html;
441 441
 	}
@@ -444,20 +444,20 @@  discard block
 block discarded – undo
444 444
 	 * Update the epiaode embed code via ajax
445 445
 	 * @return void
446 446
 	 */
447
-	public function update_episode_embed_code () {
447
+	public function update_episode_embed_code() {
448 448
 
449 449
 		// Make sure we have a valid post ID
450
-		if( empty( $_POST['post_id'] ) ) {
450
+		if ( empty( $_POST[ 'post_id' ] ) ) {
451 451
 			return;
452 452
 		}
453 453
 
454 454
 		// Get info for embed code
455
-		$post_id = (int) $_POST['post_id'];
456
-		$width = (int) $_POST['width'];
457
-		$height = (int) $_POST['height'];
455
+		$post_id = (int) $_POST[ 'post_id' ];
456
+		$width = (int) $_POST[ 'width' ];
457
+		$height = (int) $_POST[ 'height' ];
458 458
 
459 459
 		// Generate embed code
460
-		echo get_post_embed_html( $width, $height, $post_id );
460
+		echo get_post_embed_html ( $width, $height, $post_id );
461 461
 
462 462
 		// Exit after ajax request
463 463
 		exit;
@@ -470,82 +470,82 @@  discard block
 block discarded – undo
470 470
 	public function meta_box_content() {
471 471
 		global $post_id;
472 472
 
473
-		$field_data = $this->custom_fields();
473
+		$field_data = $this->custom_fields ();
474 474
 
475 475
 		$html = '';
476 476
 
477
-		$html .= '<input type="hidden" name="seriouslysimple_' . $this->token . '_nonce" id="seriouslysimple_' . $this->token . '_nonce" value="' . wp_create_nonce( plugin_basename( $this->dir ) ) . '" />';
477
+		$html .= '<input type="hidden" name="seriouslysimple_'.$this->token.'_nonce" id="seriouslysimple_'.$this->token.'_nonce" value="'.wp_create_nonce ( plugin_basename ( $this->dir ) ).'" />';
478 478
 
479
-		if ( 0 < count( $field_data ) ) {
479
+		if ( 0 < count ( $field_data ) ) {
480 480
 
481
-			$html .= '<input id="seriouslysimple_post_id" type="hidden" value="'. $post_id . '" />';
481
+			$html .= '<input id="seriouslysimple_post_id" type="hidden" value="'.$post_id.'" />';
482 482
 
483 483
 			foreach ( $field_data as $k => $v ) {
484
-				$data = $v['default'];
485
-				$saved = get_post_meta( $post_id, $k, true );
484
+				$data = $v[ 'default' ];
485
+				$saved = get_post_meta ( $post_id, $k, true );
486 486
 				if ( $saved ) {
487 487
 					$data = $saved;
488 488
 				}
489 489
 
490 490
 				$class = '';
491
-				if ( isset( $v['class'] ) ) {
492
-					$class = $v['class'];
491
+				if ( isset( $v[ 'class' ] ) ) {
492
+					$class = $v[ 'class' ];
493 493
 				}
494 494
 
495 495
 				$disabled = false;
496
-				if ( isset( $v['disabled'] ) && $v['disabled'] ) {
496
+				if ( isset( $v[ 'disabled' ] ) && $v[ 'disabled' ] ) {
497 497
 					$disabled = true;
498 498
 				}
499 499
 
500
-				switch( $v['type'] ) {
500
+				switch ( $v[ 'type' ] ) {
501 501
 					case 'file':
502 502
 						$html .= '<p>
503
-									<label class="ssp-episode-details-label" for="' . esc_attr( $k ) . '">' . $v['name'] . '</label>
503
+									<label class="ssp-episode-details-label" for="' . esc_attr ( $k ).'">'.$v[ 'name' ].'</label>
504 504
 									<br/>
505
-									<input name="' . esc_attr( $k ) . '" type="text" id="upload_' . esc_attr( $k ) . '" value="' . esc_attr( $data ) . '" />
506
-									<input type="button" class="button" id="upload_' . esc_attr( $k ) . '_button" value="' . __( 'Upload File' , 'seriously-simple-podcasting' ) . '" data-uploader_title="' . __( 'Choose a file', 'seriously-simple-podcasting' ) . '" data-uploader_button_text="' . __( 'Insert podcast file', 'seriously-simple-podcasting' ) . '" />
505
+									<input name="' . esc_attr ( $k ).'" type="text" id="upload_'.esc_attr ( $k ).'" value="'.esc_attr ( $data ).'" />
506
+									<input type="button" class="button" id="upload_' . esc_attr ( $k ).'_button" value="'.__ ( 'Upload File', 'seriously-simple-podcasting' ).'" data-uploader_title="'.__ ( 'Choose a file', 'seriously-simple-podcasting' ).'" data-uploader_button_text="'.__ ( 'Insert podcast file', 'seriously-simple-podcasting' ).'" />
507 507
 									<br/>
508
-									<span class="description">' . $v['description'] . '</span>
508
+									<span class="description">' . $v[ 'description' ].'</span>
509 509
 								</p>' . "\n";
510 510
 					break;
511 511
 
512 512
 					case 'checkbox':
513
-						$html .= '<p><input name="' . esc_attr( $k ) . '" type="checkbox" class="' . esc_attr( $class ) . '" id="' . esc_attr( $k ) . '" ' . checked( 'on' , $data , false ) . ' /> <label for="' . esc_attr( $k ) . '"><span>' . $v['description'] . '</span></label></p>' . "\n";
513
+						$html .= '<p><input name="'.esc_attr ( $k ).'" type="checkbox" class="'.esc_attr ( $class ).'" id="'.esc_attr ( $k ).'" '.checked ( 'on', $data, false ).' /> <label for="'.esc_attr ( $k ).'"><span>'.$v[ 'description' ].'</span></label></p>'."\n";
514 514
 					break;
515 515
 
516 516
 					case 'radio':
517 517
 						$html .= '<p>
518
-									<span class="ssp-episode-details-label">' . $v['name'] . '</span><br/>';
519
-										foreach( $v['options'] as $option => $label ) {
520
-											$html .= '<input style="vertical-align: bottom;" name="' . esc_attr( $k ) . '" type="radio" class="' . esc_attr( $class ) . '" id="' . esc_attr( $k ) . '_' . esc_attr( $option ) . '" ' . checked( $option , $data , false ) . ' value="' . esc_attr( $option ) . '" />
521
-											<label style="margin-right:10px;" for="' . esc_attr( $k ) . '_' . esc_attr( $option ) . '">' . esc_html( $label ) . '</label>' . "\n";
518
+									<span class="ssp-episode-details-label">' . $v[ 'name' ].'</span><br/>';
519
+										foreach ( $v[ 'options' ] as $option => $label ) {
520
+											$html .= '<input style="vertical-align: bottom;" name="'.esc_attr ( $k ).'" type="radio" class="'.esc_attr ( $class ).'" id="'.esc_attr ( $k ).'_'.esc_attr ( $option ).'" '.checked ( $option, $data, false ).' value="'.esc_attr ( $option ).'" />
521
+											<label style="margin-right:10px;" for="' . esc_attr ( $k ).'_'.esc_attr ( $option ).'">'.esc_html ( $label ).'</label>'."\n";
522 522
 										}
523
-						$html .= '<span class="description">' . $v['description'] . '</span>
523
+						$html .= '<span class="description">'.$v[ 'description' ].'</span>
524 524
 								</p>' . "\n";
525 525
 					break;
526 526
 
527 527
 					case 'datepicker':
528 528
 						$display_date = '';
529
-						if( $data ) {
530
-							$display_date = date( 'j F, Y', strtotime( $data ) );
529
+						if ( $data ) {
530
+							$display_date = date ( 'j F, Y', strtotime ( $data ) );
531 531
 						}
532 532
 						$html .= '<p class="hasDatepicker">
533
-									<label class="ssp-episode-details-label" for="' . esc_attr( $k ) . '_display">' . $v['name'] . '</label>
533
+									<label class="ssp-episode-details-label" for="' . esc_attr ( $k ).'_display">'.$v[ 'name' ].'</label>
534 534
 									<br/>
535
-									<input type="text" id="' . esc_attr( $k ) . '_display" class="ssp-datepicker ' . esc_attr( $class ) . '" value="' . esc_attr( $display_date ) . '" />
536
-									<input name="' . esc_attr( $k ) . '" id="' . esc_attr( $k ) . '" type="hidden" value="' . esc_attr( $data ) . '" />
535
+									<input type="text" id="' . esc_attr ( $k ).'_display" class="ssp-datepicker '.esc_attr ( $class ).'" value="'.esc_attr ( $display_date ).'" />
536
+									<input name="' . esc_attr ( $k ).'" id="'.esc_attr ( $k ).'" type="hidden" value="'.esc_attr ( $data ).'" />
537 537
 									<br/>
538
-									<span class="description">' . $v['description'] . '</span>
538
+									<span class="description">' . $v[ 'description' ].'</span>
539 539
 								</p>' . "\n";
540 540
 					break;
541 541
 
542 542
 					default:
543 543
 						$html .= '<p>
544
-									<label class="ssp-episode-details-label" for="' . esc_attr( $k ) . '">' . $v['name'] . '</label>
544
+									<label class="ssp-episode-details-label" for="' . esc_attr ( $k ).'">'.$v[ 'name' ].'</label>
545 545
 									<br/>
546
-									<input name="' . esc_attr( $k ) . '" type="text" id="' . esc_attr( $k ) . '" class="' . esc_attr( $class ) . '" value="' . esc_attr( $data ) . '" />
546
+									<input name="' . esc_attr ( $k ).'" type="text" id="'.esc_attr ( $k ).'" class="'.esc_attr ( $class ).'" value="'.esc_attr ( $data ).'" />
547 547
 									<br/>
548
-									<span class="description">' . $v['description'] . '</span>
548
+									<span class="description">' . $v[ 'description' ].'</span>
549 549
 								</p>' . "\n";
550 550
 					break;
551 551
 				}
@@ -564,78 +564,78 @@  discard block
 block discarded – undo
564 564
 	public function meta_box_save( $post_id ) {
565 565
 		global $ss_podcasting;
566 566
 
567
-		$podcast_post_types = ssp_post_types( true );
567
+		$podcast_post_types = ssp_post_types ( true );
568 568
 
569 569
 		// Post type check
570
-		if ( ! in_array( get_post_type(), $podcast_post_types ) ) {
570
+		if ( ! in_array ( get_post_type (), $podcast_post_types ) ) {
571 571
 			return false;
572 572
 		}
573 573
 
574 574
 		// Security check
575
-		if ( ! isset( $_POST['seriouslysimple_' . $this->token . '_nonce'] ) || ! ( isset( $_POST['seriouslysimple_' . $this->token . '_nonce'] ) && wp_verify_nonce( $_POST['seriouslysimple_' . $this->token . '_nonce'], plugin_basename( $this->dir ) ) ) ) {
575
+		if ( ! isset( $_POST[ 'seriouslysimple_'.$this->token.'_nonce' ] ) || ! ( isset( $_POST[ 'seriouslysimple_'.$this->token.'_nonce' ] ) && wp_verify_nonce ( $_POST[ 'seriouslysimple_'.$this->token.'_nonce' ], plugin_basename ( $this->dir ) ) ) ) {
576 576
 			return $post_id;
577 577
 		}
578 578
 
579 579
 		// User capability check
580
-		if ( 'page' == $_POST['post_type'] ) {
581
-			if ( ! current_user_can( 'edit_page', $post_id ) ) {
580
+		if ( 'page' == $_POST[ 'post_type' ] ) {
581
+			if ( ! current_user_can ( 'edit_page', $post_id ) ) {
582 582
 				return $post_id;
583 583
 			}
584 584
 		} else {
585
-			if ( ! current_user_can( 'edit_post', $post_id ) ) {
585
+			if ( ! current_user_can ( 'edit_post', $post_id ) ) {
586 586
 				return $post_id;
587 587
 			}
588 588
 		}
589 589
 
590
-		$field_data = $this->custom_fields();
590
+		$field_data = $this->custom_fields ();
591 591
 		$enclosure = '';
592 592
 
593 593
 		foreach ( $field_data as $k => $field ) {
594 594
 
595
-			if( 'embed_code' == $k ) {
595
+			if ( 'embed_code' == $k ) {
596 596
 				continue;
597 597
 			}
598 598
 
599 599
 			$val = '';
600 600
 			if ( isset( $_POST[ $k ] ) ) {
601
-				$val = strip_tags( trim( $_POST[ $k ] ) );
601
+				$val = strip_tags ( trim ( $_POST[ $k ] ) );
602 602
 			}
603 603
 
604 604
 			if ( $k == 'audio_file' ) {
605 605
 				$enclosure = $val;
606 606
 			}
607 607
 
608
-			update_post_meta( $post_id, $k, $val );
608
+			update_post_meta ( $post_id, $k, $val );
609 609
 		}
610 610
 
611 611
 		if ( $enclosure ) {
612 612
 
613 613
 			// Get file duration
614
-			if ( get_post_meta( $post_id, 'duration', true ) == '' ) {
615
-				$duration = $ss_podcasting->get_file_duration( $enclosure );
614
+			if ( get_post_meta ( $post_id, 'duration', true ) == '' ) {
615
+				$duration = $ss_podcasting->get_file_duration ( $enclosure );
616 616
 				if ( $duration ) {
617
-					update_post_meta( $post_id , 'duration' , $duration );
617
+					update_post_meta ( $post_id, 'duration', $duration );
618 618
 				}
619 619
 			}
620 620
 
621 621
 			// Get file size
622
-			if ( get_post_meta( $post_id, 'filesize', true ) == '' ) {
623
-				$filesize = $ss_podcasting->get_file_size( $enclosure );
622
+			if ( get_post_meta ( $post_id, 'filesize', true ) == '' ) {
623
+				$filesize = $ss_podcasting->get_file_size ( $enclosure );
624 624
 				if ( $filesize ) {
625 625
 
626
-					if ( isset( $filesize['formatted'] ) ) {
627
-						update_post_meta( $post_id, 'filesize', $filesize['formatted'] );
626
+					if ( isset( $filesize[ 'formatted' ] ) ) {
627
+						update_post_meta ( $post_id, 'filesize', $filesize[ 'formatted' ] );
628 628
 					}
629 629
 
630
-					if ( isset( $filesize['raw'] ) ) {
631
-						update_post_meta( $post_id, 'filesize_raw', $filesize['raw'] );
630
+					if ( isset( $filesize[ 'raw' ] ) ) {
631
+						update_post_meta ( $post_id, 'filesize_raw', $filesize[ 'raw' ] );
632 632
 					}
633 633
 
634 634
 				}
635 635
 			}
636 636
 
637 637
 			// Save podcast file to 'enclosure' meta field for standards-sake
638
-			update_post_meta( $post_id, 'enclosure', $enclosure );
638
+			update_post_meta ( $post_id, 'enclosure', $enclosure );
639 639
 
640 640
 		}
641 641
 
@@ -649,72 +649,72 @@  discard block
 block discarded – undo
649 649
 		global $pagenow;
650 650
 		$fields = array();
651 651
 
652
-		$fields['episode_type'] = array(
653
-			'name' => __( 'Episode type:' , 'seriously-simple-podcasting' ),
652
+		$fields[ 'episode_type' ] = array(
653
+			'name' => __ ( 'Episode type:', 'seriously-simple-podcasting' ),
654 654
 		    'description' => '',
655 655
 		    'type' => 'radio',
656 656
 		    'default' => 'audio',
657
-		    'options' => array( 'audio' => __( 'Audio', 'seriously-simple-podcasting' ), 'video' => __( 'Video', 'seriously-simple-podcasting' ) ),
657
+		    'options' => array( 'audio' => __ ( 'Audio', 'seriously-simple-podcasting' ), 'video' => __ ( 'Video', 'seriously-simple-podcasting' ) ),
658 658
 		    'section' => 'info',
659
-		    'meta_description' => __( 'The type of podcast episode - either Audio or Video', 'seriously-simple-podcasting' ),
659
+		    'meta_description' => __ ( 'The type of podcast episode - either Audio or Video', 'seriously-simple-podcasting' ),
660 660
 		);
661 661
 
662 662
 		// In v1.14+ the `audio_file` field can actually be either audio or video, but we're keeping the field name here for backwards compatibility
663
-		$fields['audio_file'] = array(
664
-		    'name' => __( 'Podcast file:' , 'seriously-simple-podcasting' ),
665
-		    'description' => __( 'Upload the primary podcast file or paste the file URL here.' , 'seriously-simple-podcasting' ),
663
+		$fields[ 'audio_file' ] = array(
664
+		    'name' => __ ( 'Podcast file:', 'seriously-simple-podcasting' ),
665
+		    'description' => __ ( 'Upload the primary podcast file or paste the file URL here.', 'seriously-simple-podcasting' ),
666 666
 		    'type' => 'file',
667 667
 		    'default' => '',
668 668
 		    'section' => 'info',
669
-		    'meta_description' => __( 'The full URL for the podcast episode media file.', 'seriously-simple-podcasting' ),
669
+		    'meta_description' => __ ( 'The full URL for the podcast episode media file.', 'seriously-simple-podcasting' ),
670 670
 		);
671 671
 
672
-		$fields['duration'] = array(
673
-		    'name' => __( 'Duration:' , 'seriously-simple-podcasting' ),
674
-		    'description' => __( 'Duration of podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
672
+		$fields[ 'duration' ] = array(
673
+		    'name' => __ ( 'Duration:', 'seriously-simple-podcasting' ),
674
+		    'description' => __ ( 'Duration of podcast file for display (calculated automatically if possible).', 'seriously-simple-podcasting' ),
675 675
 		    'type' => 'text',
676 676
 		    'default' => '',
677 677
 		    'section' => 'info',
678
-		    'meta_description' => __( 'The duration of the file for display purposes.', 'seriously-simple-podcasting' ),
678
+		    'meta_description' => __ ( 'The duration of the file for display purposes.', 'seriously-simple-podcasting' ),
679 679
 		);
680 680
 
681
-		$fields['filesize'] = array(
682
-		    'name' => __( 'File size:' , 'seriously-simple-podcasting' ),
683
-		    'description' => __( 'Size of the podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ),
681
+		$fields[ 'filesize' ] = array(
682
+		    'name' => __ ( 'File size:', 'seriously-simple-podcasting' ),
683
+		    'description' => __ ( 'Size of the podcast file for display (calculated automatically if possible).', 'seriously-simple-podcasting' ),
684 684
 		    'type' => 'text',
685 685
 		    'default' => '',
686 686
 		    'section' => 'info',
687
-		    'meta_description' => __( 'The size of the podcast episode for display purposes.', 'seriously-simple-podcasting' ),
687
+		    'meta_description' => __ ( 'The size of the podcast episode for display purposes.', 'seriously-simple-podcasting' ),
688 688
 		);
689 689
 
690
-		$fields['date_recorded'] = array(
691
-		    'name' => __( 'Date recorded:' , 'seriously-simple-podcasting' ),
692
-		    'description' => __( 'The date on which this episode was recorded.' , 'seriously-simple-podcasting' ),
690
+		$fields[ 'date_recorded' ] = array(
691
+		    'name' => __ ( 'Date recorded:', 'seriously-simple-podcasting' ),
692
+		    'description' => __ ( 'The date on which this episode was recorded.', 'seriously-simple-podcasting' ),
693 693
 		    'type' => 'datepicker',
694 694
 		    'default' => '',
695 695
 		    'section' => 'info',
696
-		    'meta_description' => __( 'The date on which the podcast episode was recorded.', 'seriously-simple-podcasting' ),
696
+		    'meta_description' => __ ( 'The date on which the podcast episode was recorded.', 'seriously-simple-podcasting' ),
697 697
 		);
698 698
 
699
-		$fields['explicit'] = array(
700
-		    'name' => __( 'Explicit:' , 'seriously-simple-podcasting' ),
701
-		    'description' => __( 'Mark this episode as explicit.' , 'seriously-simple-podcasting' ),
699
+		$fields[ 'explicit' ] = array(
700
+		    'name' => __ ( 'Explicit:', 'seriously-simple-podcasting' ),
701
+		    'description' => __ ( 'Mark this episode as explicit.', 'seriously-simple-podcasting' ),
702 702
 		    'type' => 'checkbox',
703 703
 		    'default' => '',
704 704
 		    'section' => 'info',
705
-		    'meta_description' => __( 'Indicates whether the episode is explicit or not.', 'seriously-simple-podcasting' ),
705
+		    'meta_description' => __ ( 'Indicates whether the episode is explicit or not.', 'seriously-simple-podcasting' ),
706 706
 		);
707 707
 
708
-		$fields['block'] = array(
709
-		    'name' => __( 'Block:' , 'seriously-simple-podcasting' ),
710
-		    'description' => __( 'Block this episode from appearing in the iTunes & Google Play podcast libraries.' , 'seriously-simple-podcasting' ),
708
+		$fields[ 'block' ] = array(
709
+		    'name' => __ ( 'Block:', 'seriously-simple-podcasting' ),
710
+		    'description' => __ ( 'Block this episode from appearing in the iTunes & Google Play podcast libraries.', 'seriously-simple-podcasting' ),
711 711
 		    'type' => 'checkbox',
712 712
 		    'default' => '',
713 713
 		    'section' => 'info',
714
-		    'meta_description' => __( 'Indicates whether this specific episode should be blocked from the iTunes and Google Play Podcast libraries.', 'seriously-simple-podcasting' ),
714
+		    'meta_description' => __ ( 'Indicates whether this specific episode should be blocked from the iTunes and Google Play Podcast libraries.', 'seriously-simple-podcasting' ),
715 715
 		);
716 716
 
717
-		return apply_filters( 'ssp_episode_fields', $fields );
717
+		return apply_filters ( 'ssp_episode_fields', $fields );
718 718
 	}
719 719
 
720 720
 	/**
@@ -724,17 +724,17 @@  discard block
 block discarded – undo
724 724
 	 */
725 725
 	public function glance_items( $items = array() ) {
726 726
 
727
-		$num_posts = count( ssp_episodes( -1, '', false, 'glance' ) );
727
+		$num_posts = count ( ssp_episodes ( -1, '', false, 'glance' ) );
728 728
 
729
-		$post_type_object = get_post_type_object( $this->token );
729
+		$post_type_object = get_post_type_object ( $this->token );
730 730
 
731
-		$text = _n( '%s Episode', '%s Episodes', $num_posts, 'seriously-simple-podcasting' );
732
-		$text = sprintf( $text, number_format_i18n( $num_posts ) );
731
+		$text = _n ( '%s Episode', '%s Episodes', $num_posts, 'seriously-simple-podcasting' );
732
+		$text = sprintf ( $text, number_format_i18n ( $num_posts ) );
733 733
 
734
-		if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) {
735
-			$items[] = sprintf( '<a class="%1$s-count" href="edit.php?post_type=%1$s">%2$s</a>', $this->token, $text ) . "\n";
734
+		if ( $post_type_object && current_user_can ( $post_type_object->cap->edit_posts ) ) {
735
+			$items[ ] = sprintf ( '<a class="%1$s-count" href="edit.php?post_type=%1$s">%2$s</a>', $this->token, $text )."\n";
736 736
 		} else {
737
-			$items[] = sprintf( '<span class="%1$s-count">%2$s</span>', $this->token, $text ) . "\n";
737
+			$items[ ] = sprintf ( '<span class="%1$s-count">%2$s</span>', $this->token, $text )."\n";
738 738
 		}
739 739
 
740 740
 		return $items;
@@ -748,15 +748,15 @@  discard block
 block discarded – undo
748 748
 	 * @param  string $status      Plugin status
749 749
 	 * @return array               Modified plugin meta links
750 750
 	 */
751
-	public function plugin_row_meta ( $plugin_meta = array(), $plugin_file = '', $plugin_data = array(), $status = '' ) {
751
+	public function plugin_row_meta( $plugin_meta = array(), $plugin_file = '', $plugin_data = array(), $status = '' ) {
752 752
 
753
-		if ( ! isset( $plugin_data['slug'] ) || 'seriously-simple-podcasting' != $plugin_data['slug'] ) {
753
+		if ( ! isset( $plugin_data[ 'slug' ] ) || 'seriously-simple-podcasting' != $plugin_data[ 'slug' ] ) {
754 754
 			return $plugin_meta;
755 755
 		}
756 756
 
757
-		$plugin_meta['docs'] = '<a href="http://www.seriouslysimplepodcasting.com/documentation/" target="_blank">' . __( 'Documentation', 'seriously-simple-podcasting' ) . '</a>';
758
-		$plugin_meta['addons'] = '<a href="http://www.seriouslysimplepodcasting.com/add-ons/" target="_blank">' . __( 'Add-ons', 'seriously-simple-podcasting' ) . '</a>';
759
-		$plugin_meta['review'] = '<a href="https://wordpress.org/support/view/plugin-reviews/' . $plugin_data['slug'] . '?rate=5#postform" target="_blank">' . __( 'Write a review', 'seriously-simple-podcasting' ) . '</a>';
757
+		$plugin_meta[ 'docs' ] = '<a href="http://www.seriouslysimplepodcasting.com/documentation/" target="_blank">'.__ ( 'Documentation', 'seriously-simple-podcasting' ).'</a>';
758
+		$plugin_meta[ 'addons' ] = '<a href="http://www.seriouslysimplepodcasting.com/add-ons/" target="_blank">'.__ ( 'Add-ons', 'seriously-simple-podcasting' ).'</a>';
759
+		$plugin_meta[ 'review' ] = '<a href="https://wordpress.org/support/view/plugin-reviews/'.$plugin_data[ 'slug' ].'?rate=5#postform" target="_blank">'.__ ( 'Write a review', 'seriously-simple-podcasting' ).'</a>';
760 760
 
761 761
 		return $plugin_meta;
762 762
 	}
@@ -767,8 +767,8 @@  discard block
 block discarded – undo
767 767
 	 * @return string        Modified text
768 768
 	 */
769 769
 	public function enter_title_here( $title ) {
770
-		if ( get_post_type() == $this->token ) {
771
-			$title = __( 'Enter episode title here', 'seriously-simple-podcasting' );
770
+		if ( get_post_type () == $this->token ) {
771
+			$title = __ ( 'Enter episode title here', 'seriously-simple-podcasting' );
772 772
 		}
773 773
 		return $title;
774 774
 	}
@@ -778,11 +778,11 @@  discard block
 block discarded – undo
778 778
 	 * @return void
779 779
 	 */
780 780
 	public function enqueue_admin_styles() {
781
-		wp_register_style( 'ssp-admin', esc_url( $this->assets_url . 'css/admin.css' ), array(), $this->version );
782
-		wp_enqueue_style( 'ssp-admin' );
781
+		wp_register_style ( 'ssp-admin', esc_url ( $this->assets_url.'css/admin.css' ), array(), $this->version );
782
+		wp_enqueue_style ( 'ssp-admin' );
783 783
 
784 784
 		// Datepicker
785
-		wp_enqueue_style( 'jquery-ui-datepicker', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css' );
785
+		wp_enqueue_style ( 'jquery-ui-datepicker', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css' );
786 786
 	}
787 787
 
788 788
 	/**
@@ -790,8 +790,8 @@  discard block
 block discarded – undo
790 790
 	 * @return void
791 791
 	 */
792 792
 	public function enqueue_admin_scripts() {
793
-		wp_register_script( 'ssp-admin', esc_url( $this->assets_url . 'js/admin' . $this->script_suffix . '.js' ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker' ), $this->version );
794
-		wp_enqueue_script( 'ssp-admin' );
793
+		wp_register_script ( 'ssp-admin', esc_url ( $this->assets_url.'js/admin'.$this->script_suffix.'.js' ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker' ), $this->version );
794
+		wp_enqueue_script ( 'ssp-admin' );
795 795
 	}
796 796
 
797 797
 	/**
@@ -799,8 +799,8 @@  discard block
 block discarded – undo
799 799
 	 * @return void
800 800
 	 */
801 801
 	public function ensure_post_thumbnails_support() {
802
-		if ( ! current_theme_supports( 'post-thumbnails' ) ) {
803
-			add_theme_support( 'post-thumbnails' );
802
+		if ( ! current_theme_supports ( 'post-thumbnails' ) ) {
803
+			add_theme_support ( 'post-thumbnails' );
804 804
 		}
805 805
 	}
806 806
 
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 	 * @return void
810 810
 	 */
811 811
 	public function load_localisation() {
812
-		load_plugin_textdomain( 'seriously-simple-podcasting', false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
812
+		load_plugin_textdomain ( 'seriously-simple-podcasting', false, dirname ( plugin_basename ( $this->file ) ).'/lang/' );
813 813
 	}
814 814
 
815 815
 	/**
@@ -819,10 +819,10 @@  discard block
 block discarded – undo
819 819
 	public function load_plugin_textdomain() {
820 820
 	    $domain = 'seriously-simple-podcasting';
821 821
 	    // The "plugin_locale" filter is also used in load_plugin_textdomain()
822
-	    $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
822
+	    $locale = apply_filters ( 'plugin_locale', get_locale (), $domain );
823 823
 
824
-	    load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
825
-	    load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
824
+	    load_textdomain ( $domain, WP_LANG_DIR.'/'.$domain.'/'.$domain.'-'.$locale.'.mo' );
825
+	    load_plugin_textdomain ( $domain, false, dirname ( plugin_basename ( $this->file ) ).'/lang/' );
826 826
 	}
827 827
 
828 828
     /**
@@ -830,8 +830,8 @@  discard block
 block discarded – undo
830 830
      * @return void
831 831
      */
832 832
     public function add_feed() {
833
-    	$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
834
-		add_feed( $feed_slug, array( $this, 'feed_template' ) );
833
+    	$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
834
+		add_feed ( $feed_slug, array( $this, 'feed_template' ) );
835 835
 	}
836 836
 
837 837
 	/**
@@ -839,9 +839,9 @@  discard block
 block discarded – undo
839 839
 	 * @param  boolean $include_footer Default inclusion value
840 840
 	 * @return boolean                 Modified inclusion value
841 841
 	 */
842
-	public function hide_wp_seo_rss_footer ( $include_footer = true ) {
842
+	public function hide_wp_seo_rss_footer( $include_footer = true ) {
843 843
 
844
-		if ( is_feed( 'podcast' ) ) {
844
+		if ( is_feed ( 'podcast' ) ) {
845 845
 			$include_footer = false;
846 846
 		}
847 847
 
@@ -857,24 +857,24 @@  discard block
 block discarded – undo
857 857
 
858 858
     	// Prevent 404 on feed
859 859
     	$wp_query->is_404 = false;
860
-    	status_header( 200 );
860
+    	status_header ( 200 );
861 861
 
862 862
     	$file_name = 'feed-podcast.php';
863 863
 
864
-    	$user_template_file = apply_filters( 'ssp_feed_template_file', trailingslashit( get_stylesheet_directory() ) . $file_name );
864
+    	$user_template_file = apply_filters ( 'ssp_feed_template_file', trailingslashit ( get_stylesheet_directory () ).$file_name );
865 865
 
866 866
 		// Any functions hooked in here must NOT output any data or else feed will break
867
-		do_action( 'ssp_before_feed' );
867
+		do_action ( 'ssp_before_feed' );
868 868
 
869 869
     	// Load user feed template if it exists, otherwise use plugin template
870
-    	if ( file_exists( $user_template_file ) ) {
870
+    	if ( file_exists ( $user_template_file ) ) {
871 871
     		require( $user_template_file );
872 872
     	} else {
873
-    		require( $this->template_path . $file_name );
873
+    		require( $this->template_path.$file_name );
874 874
     	}
875 875
 
876 876
     	// Any functions hooked in here must NOT output any data or else feed will break
877
-    	do_action( 'ssp_after_feed' );
877
+    	do_action ( 'ssp_after_feed' );
878 878
 
879 879
     	exit;
880 880
 	}
@@ -884,8 +884,8 @@  discard block
 block discarded – undo
884 884
 	 * @return void
885 885
 	 */
886 886
 	public function redirect_old_feed() {
887
-		if ( isset( $_GET['feed'] ) && in_array( $_GET['feed'], array( 'podcast', 'itunes' ) ) ) {
888
-			$this->feed_template();
887
+		if ( isset( $_GET[ 'feed' ] ) && in_array ( $_GET[ 'feed' ], array( 'podcast', 'itunes' ) ) ) {
888
+			$this->feed_template ();
889 889
 			exit;
890 890
 		}
891 891
 	}
@@ -897,12 +897,12 @@  discard block
 block discarded – undo
897 897
 	public function activate() {
898 898
 
899 899
 		// Setup all custom URL rules
900
-		$this->register_post_type();
901
-		$this->add_feed();
902
-		$this->setup_permastruct();
900
+		$this->register_post_type ();
901
+		$this->add_feed ();
902
+		$this->setup_permastruct ();
903 903
 
904 904
 		// Flush permalinks
905
-		flush_rewrite_rules( true );
905
+		flush_rewrite_rules ( true );
906 906
 	}
907 907
 
908 908
 	/**
@@ -910,37 +910,37 @@  discard block
 block discarded – undo
910 910
 	 * @return void
911 911
 	 */
912 912
 	public function deactivate() {
913
-		flush_rewrite_rules();
913
+		flush_rewrite_rules ();
914 914
 	}
915 915
 
916 916
 	/**
917 917
 	 * Run functions on plugin update/activation
918 918
 	 * @return void
919 919
 	 */
920
-	public function update () {
920
+	public function update() {
921 921
 
922
-		$previous_version = get_option( 'ssp_version', '1.0' );
922
+		$previous_version = get_option ( 'ssp_version', '1.0' );
923 923
 
924
-		if ( version_compare( $previous_version, '1.13.1', '<' ) ) {
925
-			flush_rewrite_rules();
924
+		if ( version_compare ( $previous_version, '1.13.1', '<' ) ) {
925
+			flush_rewrite_rules ();
926 926
 		}
927 927
 
928
-		update_option( 'ssp_version', $this->version );
928
+		update_option ( 'ssp_version', $this->version );
929 929
 	}
930 930
 
931 931
 	/**
932 932
 	 * Update 'enclosure' meta field to 'audio_file' meta field
933 933
 	 * @return void
934 934
 	 */
935
-	public function update_enclosures () {
935
+	public function update_enclosures() {
936 936
 
937 937
 		// Allow forced re-run of update if necessary
938
-		if ( isset( $_GET['ssp_update_enclosures'] ) ) {
939
-			delete_option( 'ssp_update_enclosures' );
938
+		if ( isset( $_GET[ 'ssp_update_enclosures' ] ) ) {
939
+			delete_option ( 'ssp_update_enclosures' );
940 940
 		}
941 941
 
942 942
 		// Check if update has been run
943
-		$update_run = get_option( 'ssp_update_enclosures', false );
943
+		$update_run = get_option ( 'ssp_update_enclosures', false );
944 944
 
945 945
 		if ( $update_run ) {
946 946
 			return;
@@ -961,9 +961,9 @@  discard block
 block discarded – undo
961 961
 			'fields' => 'ids',
962 962
 		);
963 963
 
964
-		$posts_with_enclosures = get_posts( $args );
964
+		$posts_with_enclosures = get_posts ( $args );
965 965
 
966
-		if ( 0 == count( $posts_with_enclosures ) ) {
966
+		if ( 0 == count ( $posts_with_enclosures ) ) {
967 967
 			return;
968 968
 		}
969 969
 
@@ -971,17 +971,17 @@  discard block
 block discarded – undo
971 971
 		foreach ( (array) $posts_with_enclosures as $post_id ) {
972 972
 
973 973
 			// Get existing enclosure
974
-			$enclosure = get_post_meta( $post_id, 'enclosure', true );
974
+			$enclosure = get_post_meta ( $post_id, 'enclosure', true );
975 975
 
976 976
 			// Add audio_file field
977 977
 			if ( $enclosure ) {
978
-				update_post_meta( $post_id, 'audio_file', $enclosure );
978
+				update_post_meta ( $post_id, 'audio_file', $enclosure );
979 979
 			}
980 980
 
981 981
 		}
982 982
 
983 983
 		// Mark update as having been run
984
-		update_option( 'ssp_update_enclosures', 'run' );
984
+		update_option ( 'ssp_update_enclosures', 'run' );
985 985
 	}
986 986
 
987 987
 	/**
@@ -992,19 +992,19 @@  discard block
 block discarded – undo
992 992
 	public function admin_footer_text( $footer_text ) {
993 993
 
994 994
 		// Check to make sure we're on a SSP settings page
995
-		if ( ( isset( $_GET['page'] ) && 'podcast_settings' == esc_attr( $_GET['page'] ) ) && apply_filters( 'ssp_display_admin_footer_text', true ) ) {
995
+		if ( ( isset( $_GET[ 'page' ] ) && 'podcast_settings' == esc_attr ( $_GET[ 'page' ] ) ) && apply_filters ( 'ssp_display_admin_footer_text', true ) ) {
996 996
 
997 997
 			// Change the footer text
998
-			if ( ! get_option( 'ssp_admin_footer_text_rated' ) ) {
999
-				$footer_text = sprintf( __( 'If you like %1$sSeriously Simple Podcasting%2$s please leave a %3$s&#9733;&#9733;&#9733;&#9733;&#9733;%4$s rating. A huge thank you in advance!', 'seriously-simple-podcasting' ), '<strong>', '</strong>', '<a href="https://wordpress.org/support/view/plugin-reviews/seriously-simple-podcasting?filter=5#postform" target="_blank" class="ssp-rating-link" data-rated="' . __( 'Thanks!', 'seriously-simple-podcasting' ) . '">', '</a>' );
998
+			if ( ! get_option ( 'ssp_admin_footer_text_rated' ) ) {
999
+				$footer_text = sprintf ( __ ( 'If you like %1$sSeriously Simple Podcasting%2$s please leave a %3$s&#9733;&#9733;&#9733;&#9733;&#9733;%4$s rating. A huge thank you in advance!', 'seriously-simple-podcasting' ), '<strong>', '</strong>', '<a href="https://wordpress.org/support/view/plugin-reviews/seriously-simple-podcasting?filter=5#postform" target="_blank" class="ssp-rating-link" data-rated="'.__ ( 'Thanks!', 'seriously-simple-podcasting' ).'">', '</a>' );
1000 1000
 				$footer_text .= "<script type='text/javascript'>
1001 1001
 					jQuery('a.ssp-rating-link').click(function() {
1002
-						jQuery.post( '" . admin_url( 'admin-ajax.php' ) . "', { action: 'ssp_rated' } );
1002
+						jQuery.post( '" . admin_url ( 'admin-ajax.php' )."', { action: 'ssp_rated' } );
1003 1003
 						jQuery(this).parent().text( jQuery(this).data( 'rated' ) );
1004 1004
 					});
1005 1005
 				</script>";
1006 1006
 			} else {
1007
-				$footer_text = sprintf( __( '%1$sThank you for publishing with %2$sSeriously Simple Podcasting%3$s.%4$s', 'seriously-simple-podcasting' ), '<span id="footer-thankyou">', '<a href="http://www.seriouslysimplepodcasting.com/" target="_blank">', '</a>', '</span>' );
1007
+				$footer_text = sprintf ( __ ( '%1$sThank you for publishing with %2$sSeriously Simple Podcasting%3$s.%4$s', 'seriously-simple-podcasting' ), '<span id="footer-thankyou">', '<a href="http://www.seriouslysimplepodcasting.com/" target="_blank">', '</a>', '</span>' );
1008 1008
 			}
1009 1009
 
1010 1010
 		}
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
 	 * @return void
1018 1018
 	 */
1019 1019
 	public function rated() {
1020
-		update_option( 'ssp_admin_footer_text_rated', 1 );
1020
+		update_option ( 'ssp_admin_footer_text_rated', 1 );
1021 1021
 		die();
1022 1022
 	}
1023 1023
 
@@ -1027,11 +1027,11 @@  discard block
 block discarded – undo
1027 1027
 	 * @param  object $post WordPress Post Object
1028 1028
 	 * @return void
1029 1029
 	 */
1030
-	public function invalidate_cache( $id, $post ){
1030
+	public function invalidate_cache( $id, $post ) {
1031 1031
 
1032
-		if ( in_array( $post->post_type, ssp_post_types( true ) ) ){
1033
-			wp_cache_delete( 'episodes',    'ssp' );
1034
-			wp_cache_delete( 'episode_ids', 'ssp' );
1032
+		if ( in_array ( $post->post_type, ssp_post_types ( true ) ) ) {
1033
+			wp_cache_delete ( 'episodes', 'ssp' );
1034
+			wp_cache_delete ( 'episode_ids', 'ssp' );
1035 1035
 		}
1036 1036
 
1037 1037
 	}
Please login to merge, or discard this patch.
includes/class-ssp-settings.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -928,15 +928,15 @@  discard block
 block discarded – undo
928 928
 		if ( $message ) {
929 929
 
930 930
 			$allowed = array(
931
-			    'a' => array(
932
-			        'href' => array(),
933
-			        'title' => array(),
934
-			        'target' => array()
935
-			    ),
936
-			    'br' => array(),
937
-			    'em' => array(),
938
-			    'strong' => array(),
939
-			    'p' => array()
931
+				'a' => array(
932
+					'href' => array(),
933
+					'title' => array(),
934
+					'target' => array()
935
+				),
936
+				'br' => array(),
937
+				'em' => array(),
938
+				'strong' => array(),
939
+				'p' => array()
940 940
 			);
941 941
 
942 942
 			$message = wp_kses( $message, $allowed );
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 			if( function_exists( 'php_sapi_name') && 'security' == $tab ) {
1027 1027
 				$sapi_type = php_sapi_name();
1028 1028
 				if ( strpos( $sapi_type, 'fcgi' ) !== false ) {
1029
-				    $html .= '<br/><div class="update-nag">
1029
+					$html .= '<br/><div class="update-nag">
1030 1030
 					        <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>
1031 1031
 					    </div>';
1032 1032
 				}
Please login to merge, or discard this patch.
Spacing   +352 added lines, -352 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,173 +153,173 @@  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
 			),
283 283
 		);
284 284
 
285
-		$settings['feed-details'] = array(
286
-			'title'					=> __( 'Feed details', 'seriously-simple-podcasting' ),
287
-			'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>' ),
285
+		$settings[ 'feed-details' ] = array(
286
+			'title'					=> __ ( 'Feed details', 'seriously-simple-podcasting' ),
287
+			'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>' ),
288 288
 			'fields'				=> array(
289 289
 				array(
290 290
 					'id' 			=> 'data_title',
291
-					'label'			=> __( 'Title' , 'seriously-simple-podcasting' ),
292
-					'description'	=> __( 'Your podcast title.', 'seriously-simple-podcasting' ),
291
+					'label'			=> __ ( 'Title', 'seriously-simple-podcasting' ),
292
+					'description'	=> __ ( 'Your podcast title.', 'seriously-simple-podcasting' ),
293 293
 					'type'			=> 'text',
294
-					'default'		=> get_bloginfo( 'name' ),
295
-					'placeholder'	=> get_bloginfo( 'name' ),
294
+					'default'		=> get_bloginfo ( 'name' ),
295
+					'placeholder'	=> get_bloginfo ( 'name' ),
296 296
 					'class'			=> 'large-text',
297 297
 					'callback'		=> 'wp_strip_all_tags',
298 298
 				),
299 299
 				array(
300 300
 					'id' 			=> 'data_subtitle',
301
-					'label'			=> __( 'Subtitle' , 'seriously-simple-podcasting' ),
302
-					'description'	=> __( 'Your podcast subtitle.', 'seriously-simple-podcasting' ),
301
+					'label'			=> __ ( 'Subtitle', 'seriously-simple-podcasting' ),
302
+					'description'	=> __ ( 'Your podcast subtitle.', 'seriously-simple-podcasting' ),
303 303
 					'type'			=> 'text',
304
-					'default'		=> get_bloginfo( 'description' ),
305
-					'placeholder'	=> get_bloginfo( 'description' ),
304
+					'default'		=> get_bloginfo ( 'description' ),
305
+					'placeholder'	=> get_bloginfo ( 'description' ),
306 306
 					'class'			=> 'large-text',
307 307
 					'callback'		=> 'wp_strip_all_tags',
308 308
 				),
309 309
 				array(
310 310
 					'id' 			=> 'data_author',
311
-					'label'			=> __( 'Author' , 'seriously-simple-podcasting' ),
312
-					'description'	=> __( 'Your podcast author.', 'seriously-simple-podcasting' ),
311
+					'label'			=> __ ( 'Author', 'seriously-simple-podcasting' ),
312
+					'description'	=> __ ( 'Your podcast author.', 'seriously-simple-podcasting' ),
313 313
 					'type'			=> 'text',
314
-					'default'		=> get_bloginfo( 'name' ),
315
-					'placeholder'	=> get_bloginfo( 'name' ),
314
+					'default'		=> get_bloginfo ( 'name' ),
315
+					'placeholder'	=> get_bloginfo ( 'name' ),
316 316
 					'class'			=> 'large-text',
317 317
 					'callback'		=> 'wp_strip_all_tags',
318 318
 				),
319 319
 				array(
320 320
 					'id' 			=> 'data_category',
321
-					'label'			=> __( 'Primary Category' , 'seriously-simple-podcasting' ),
322
-					'description'	=> __( 'Your podcast\'s primary category.', 'seriously-simple-podcasting' ),
321
+					'label'			=> __ ( 'Primary Category', 'seriously-simple-podcasting' ),
322
+					'description'	=> __ ( 'Your podcast\'s primary category.', 'seriously-simple-podcasting' ),
323 323
 					'type'			=> 'select',
324 324
 					'options'		=> $category_options,
325 325
 					'default'		=> '',
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
 				),
328 328
 				array(
329 329
 					'id' 			=> 'data_subcategory',
330
-					'label'			=> __( 'Primary Sub-Category' , 'seriously-simple-podcasting' ),
331
-					'description'	=> __( 'Your podcast\'s primary sub-category (if available) - must be a sub-category of the primary category selected above.', 'seriously-simple-podcasting' ),
330
+					'label'			=> __ ( 'Primary Sub-Category', 'seriously-simple-podcasting' ),
331
+					'description'	=> __ ( 'Your podcast\'s primary sub-category (if available) - must be a sub-category of the primary category selected above.', 'seriously-simple-podcasting' ),
332 332
 					'type'			=> 'select',
333 333
 					'options'		=> $subcategory_options,
334 334
 					'default'		=> '',
@@ -336,8 +336,8 @@  discard block
 block discarded – undo
336 336
 				),
337 337
 				array(
338 338
 					'id' 			=> 'data_category2',
339
-					'label'			=> __( 'Secondary Category' , 'seriously-simple-podcasting' ),
340
-					'description'	=> __( 'Your podcast\'s secondary category.', 'seriously-simple-podcasting' ),
339
+					'label'			=> __ ( 'Secondary Category', 'seriously-simple-podcasting' ),
340
+					'description'	=> __ ( 'Your podcast\'s secondary category.', 'seriously-simple-podcasting' ),
341 341
 					'type'			=> 'select',
342 342
 					'options'		=> $category_options,
343 343
 					'default'		=> '',
@@ -345,8 +345,8 @@  discard block
 block discarded – undo
345 345
 				),
346 346
 				array(
347 347
 					'id' 			=> 'data_subcategory2',
348
-					'label'			=> __( 'Secondary Sub-Category' , 'seriously-simple-podcasting' ),
349
-					'description'	=> __( 'Your podcast\'s secondary sub-category (if available) - must be a sub-category of the secondary category selected above.', 'seriously-simple-podcasting' ),
348
+					'label'			=> __ ( 'Secondary Sub-Category', 'seriously-simple-podcasting' ),
349
+					'description'	=> __ ( 'Your podcast\'s secondary sub-category (if available) - must be a sub-category of the secondary category selected above.', 'seriously-simple-podcasting' ),
350 350
 					'type'			=> 'select',
351 351
 					'options'		=> $subcategory_options,
352 352
 					'default'		=> '',
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
 				),
355 355
 				array(
356 356
 					'id' 			=> 'data_category3',
357
-					'label'			=> __( 'Tertiary Category' , 'seriously-simple-podcasting' ),
358
-					'description'	=> __( 'Your podcast\'s tertiary category.', 'seriously-simple-podcasting' ),
357
+					'label'			=> __ ( 'Tertiary Category', 'seriously-simple-podcasting' ),
358
+					'description'	=> __ ( 'Your podcast\'s tertiary category.', 'seriously-simple-podcasting' ),
359 359
 					'type'			=> 'select',
360 360
 					'options'		=> $category_options,
361 361
 					'default'		=> '',
@@ -363,8 +363,8 @@  discard block
 block discarded – undo
363 363
 				),
364 364
 				array(
365 365
 					'id' 			=> 'data_subcategory3',
366
-					'label'			=> __( 'Tertiary Sub-Category' , 'seriously-simple-podcasting' ),
367
-					'description'	=> __( 'Your podcast\'s tertiary sub-category (if available) - must be a sub-category of the tertiary category selected above.', 'seriously-simple-podcasting' ),
366
+					'label'			=> __ ( 'Tertiary Sub-Category', 'seriously-simple-podcasting' ),
367
+					'description'	=> __ ( 'Your podcast\'s tertiary sub-category (if available) - must be a sub-category of the tertiary category selected above.', 'seriously-simple-podcasting' ),
368 368
 					'type'			=> 'select',
369 369
 					'options'		=> $subcategory_options,
370 370
 					'default'		=> '',
@@ -372,18 +372,18 @@  discard block
 block discarded – undo
372 372
 				),
373 373
 				array(
374 374
 					'id' 			=> 'data_description',
375
-					'label'			=> __( 'Description/Summary' , 'seriously-simple-podcasting' ),
376
-					'description'	=> __( 'A description/summary of your podcast - no HTML allowed.', 'seriously-simple-podcasting' ),
375
+					'label'			=> __ ( 'Description/Summary', 'seriously-simple-podcasting' ),
376
+					'description'	=> __ ( 'A description/summary of your podcast - no HTML allowed.', 'seriously-simple-podcasting' ),
377 377
 					'type'			=> 'textarea',
378
-					'default'		=> get_bloginfo( 'description' ),
379
-					'placeholder'	=> get_bloginfo( 'description' ),
378
+					'default'		=> get_bloginfo ( 'description' ),
379
+					'placeholder'	=> get_bloginfo ( 'description' ),
380 380
 					'callback'		=> 'wp_strip_all_tags',
381 381
 					'class'			=> 'large-text',
382 382
 				),
383 383
 				array(
384 384
 					'id' 			=> 'data_image',
385
-					'label'			=> __( 'Cover Image' , 'seriously-simple-podcasting' ),
386
-					'description'	=> __( 'Your podcast cover image - must have a minimum size of 1400x1400 px.', 'seriously-simple-podcasting' ),
385
+					'label'			=> __ ( 'Cover Image', 'seriously-simple-podcasting' ),
386
+					'description'	=> __ ( 'Your podcast cover image - must have a minimum size of 1400x1400 px.', 'seriously-simple-podcasting' ),
387 387
 					'type'			=> 'image',
388 388
 					'default'		=> '',
389 389
 					'placeholder'	=> '',
@@ -391,182 +391,182 @@  discard block
 block discarded – undo
391 391
 				),
392 392
 				array(
393 393
 					'id' 			=> 'data_owner_name',
394
-					'label'			=> __( 'Owner name' , 'seriously-simple-podcasting' ),
395
-					'description'	=> __( 'Podcast owner\'s name.', 'seriously-simple-podcasting' ),
394
+					'label'			=> __ ( 'Owner name', 'seriously-simple-podcasting' ),
395
+					'description'	=> __ ( 'Podcast owner\'s name.', 'seriously-simple-podcasting' ),
396 396
 					'type'			=> 'text',
397
-					'default'		=> get_bloginfo( 'name' ),
398
-					'placeholder'	=> get_bloginfo( 'name' ),
397
+					'default'		=> get_bloginfo ( 'name' ),
398
+					'placeholder'	=> get_bloginfo ( 'name' ),
399 399
 					'class'			=> 'large-text',
400 400
 					'callback'		=> 'wp_strip_all_tags',
401 401
 				),
402 402
 				array(
403 403
 					'id' 			=> 'data_owner_email',
404
-					'label'			=> __( 'Owner email address' , 'seriously-simple-podcasting' ),
405
-					'description'	=> __( 'Podcast owner\'s email address.', 'seriously-simple-podcasting' ),
404
+					'label'			=> __ ( 'Owner email address', 'seriously-simple-podcasting' ),
405
+					'description'	=> __ ( 'Podcast owner\'s email address.', 'seriously-simple-podcasting' ),
406 406
 					'type'			=> 'text',
407
-					'default'		=> get_bloginfo( 'admin_email' ),
408
-					'placeholder'	=> get_bloginfo( 'admin_email' ),
407
+					'default'		=> get_bloginfo ( 'admin_email' ),
408
+					'placeholder'	=> get_bloginfo ( 'admin_email' ),
409 409
 					'class'			=> 'large-text',
410 410
 					'callback'		=> 'wp_strip_all_tags',
411 411
 				),
412 412
 				array(
413 413
 					'id' 			=> 'data_language',
414
-					'label'			=> __( 'Language' , 'seriously-simple-podcasting' ),
415
-					'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>' ),
414
+					'label'			=> __ ( 'Language', 'seriously-simple-podcasting' ),
415
+					'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>' ),
416 416
 					'type'			=> 'text',
417
-					'default'		=> get_bloginfo( 'language' ),
418
-					'placeholder'	=> get_bloginfo( 'language' ),
417
+					'default'		=> get_bloginfo ( 'language' ),
418
+					'placeholder'	=> get_bloginfo ( 'language' ),
419 419
 					'class'			=> 'all-options',
420 420
 					'callback'		=> 'wp_strip_all_tags',
421 421
 				),
422 422
 				array(
423 423
 					'id' 			=> 'data_copyright',
424
-					'label'			=> __( 'Copyright' , 'seriously-simple-podcasting' ),
425
-					'description'	=> __( 'Copyright line for your podcast.', 'seriously-simple-podcasting' ),
424
+					'label'			=> __ ( 'Copyright', 'seriously-simple-podcasting' ),
425
+					'description'	=> __ ( 'Copyright line for your podcast.', 'seriously-simple-podcasting' ),
426 426
 					'type'			=> 'text',
427
-					'default'		=> '&#xA9; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ),
428
-					'placeholder'	=> '&#xA9; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ),
427
+					'default'		=> '&#xA9; '.date ( 'Y' ).' '.get_bloginfo ( 'name' ),
428
+					'placeholder'	=> '&#xA9; '.date ( 'Y' ).' '.get_bloginfo ( 'name' ),
429 429
 					'class'			=> 'large-text',
430 430
 					'callback'		=> 'wp_strip_all_tags',
431 431
 				),
432 432
 				array(
433 433
 					'id' 			=> 'explicit',
434
-					'label'			=> __( 'Explicit', 'seriously-simple-podcasting' ),
435
-					'description'	=> __( 'Mark if your podcast is explicit or not.', 'seriously-simple-podcasting' ),
434
+					'label'			=> __ ( 'Explicit', 'seriously-simple-podcasting' ),
435
+					'description'	=> __ ( 'Mark if your podcast is explicit or not.', 'seriously-simple-podcasting' ),
436 436
 					'type'			=> 'checkbox',
437 437
 					'default'		=> '',
438 438
 					'callback'		=> 'wp_strip_all_tags',
439 439
 				),
440 440
 				array(
441 441
 					'id' 			=> 'complete',
442
-					'label'			=> __( 'Complete', 'seriously-simple-podcasting' ),
443
-					'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' ),
442
+					'label'			=> __ ( 'Complete', 'seriously-simple-podcasting' ),
443
+					'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' ),
444 444
 					'type'			=> 'checkbox',
445 445
 					'default'		=> '',
446 446
 					'callback'		=> 'wp_strip_all_tags',
447 447
 				),
448 448
 				array(
449 449
 					'id' 			=> 'redirect_feed',
450
-					'label'			=> __( 'Redirect this feed to new URL', 'seriously-simple-podcasting' ),
451
-					'description'	=> sprintf( __( 'Redirect your feed to a new URL (specified below).', 'seriously-simple-podcasting' ) , '<br/>' ),
450
+					'label'			=> __ ( 'Redirect this feed to new URL', 'seriously-simple-podcasting' ),
451
+					'description'	=> sprintf ( __ ( 'Redirect your feed to a new URL (specified below).', 'seriously-simple-podcasting' ), '<br/>' ),
452 452
 					'type'			=> 'checkbox',
453 453
 					'default'		=> '',
454 454
 					'callback'		=> 'wp_strip_all_tags',
455 455
 				),
456 456
 				array(
457 457
 					'id' 			=> 'new_feed_url',
458
-					'label'			=> __( 'New podcast feed URL', 'seriously-simple-podcasting' ),
459
-					'description'	=> __( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
458
+					'label'			=> __ ( 'New podcast feed URL', 'seriously-simple-podcasting' ),
459
+					'description'	=> __ ( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
460 460
 					'type'			=> 'text',
461 461
 					'default'		=> '',
462
-					'placeholder'	=> __( 'New feed URL', 'seriously-simple-podcasting' ),
462
+					'placeholder'	=> __ ( 'New feed URL', 'seriously-simple-podcasting' ),
463 463
 					'callback'		=> 'esc_url_raw',
464 464
 					'class'			=> 'regular-text',
465 465
 				),
466 466
 			)
467 467
 		);
468 468
 
469
-		$settings['security'] = array(
470
-			'title'					=> __( 'Security', 'seriously-simple-podcasting' ),
471
-			'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' ),
469
+		$settings[ 'security' ] = array(
470
+			'title'					=> __ ( 'Security', 'seriously-simple-podcasting' ),
471
+			'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' ),
472 472
 			'fields'				=> array(
473 473
 				array(
474 474
 					'id' 			=> 'protect',
475
-					'label'			=> __( 'Password protect your podcast feed', 'seriously-simple-podcasting' ),
476
-					'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' ),
475
+					'label'			=> __ ( 'Password protect your podcast feed', 'seriously-simple-podcasting' ),
476
+					'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' ),
477 477
 					'type'			=> 'checkbox',
478 478
 					'default'		=> '',
479 479
 					'callback'		=> 'wp_strip_all_tags',
480 480
 				),
481 481
 				array(
482 482
 					'id' 			=> 'protection_username',
483
-					'label'			=> __( 'Username' , 'seriously-simple-podcasting' ),
484
-					'description'	=> __( 'Username for your podcast feed.', 'seriously-simple-podcasting' ),
483
+					'label'			=> __ ( 'Username', 'seriously-simple-podcasting' ),
484
+					'description'	=> __ ( 'Username for your podcast feed.', 'seriously-simple-podcasting' ),
485 485
 					'type'			=> 'text',
486 486
 					'default'		=> '',
487
-					'placeholder'	=> __( 'Feed username', 'seriously-simple-podcasting' ),
487
+					'placeholder'	=> __ ( 'Feed username', 'seriously-simple-podcasting' ),
488 488
 					'class'			=> 'regular-text',
489 489
 					'callback'		=> 'wp_strip_all_tags',
490 490
 				),
491 491
 				array(
492 492
 					'id' 			=> 'protection_password',
493
-					'label'			=> __( 'Password' , 'seriously-simple-podcasting' ),
494
-					'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' ),
493
+					'label'			=> __ ( 'Password', 'seriously-simple-podcasting' ),
494
+					'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' ),
495 495
 					'type'			=> 'text_secret',
496 496
 					'default'		=> '',
497
-					'placeholder'	=> __( 'Feed password', 'seriously-simple-podcasting' ),
497
+					'placeholder'	=> __ ( 'Feed password', 'seriously-simple-podcasting' ),
498 498
 					'callback'		=> array( $this, 'encode_password' ),
499 499
 					'class'			=> 'regular-text',
500 500
 				),
501 501
 				array(
502 502
 					'id' 			=> 'protection_no_access_message',
503
-					'label'			=> __( 'No access message' , 'seriously-simple-podcasting' ),
504
-					'description'	=> __( 'This message will be displayed to people who are not allowed access to your podcast feed. Limited HTML allowed.', 'seriously-simple-podcasting' ),
503
+					'label'			=> __ ( 'No access message', 'seriously-simple-podcasting' ),
504
+					'description'	=> __ ( 'This message will be displayed to people who are not allowed access to your podcast feed. Limited HTML allowed.', 'seriously-simple-podcasting' ),
505 505
 					'type'			=> 'textarea',
506
-					'default'		=> __( 'You are not permitted to view this podcast feed.', 'seriously-simple-podcasting' ),
507
-					'placeholder'	=> __( 'Message displayed to users who do not have access to the podcast feed', 'seriously-simple-podcasting' ),
506
+					'default'		=> __ ( 'You are not permitted to view this podcast feed.', 'seriously-simple-podcasting' ),
507
+					'placeholder'	=> __ ( 'Message displayed to users who do not have access to the podcast feed', 'seriously-simple-podcasting' ),
508 508
 					'callback'		=> array( $this, 'validate_message' ),
509 509
 					'class'			=> 'large-text',
510 510
 				),
511 511
 			)
512 512
 		);
513 513
 
514
-		$settings['redirection'] = array(
515
-			'title'					=> __( 'Redirection', 'seriously-simple-podcasting' ),
516
-			'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' ),
514
+		$settings[ 'redirection' ] = array(
515
+			'title'					=> __ ( 'Redirection', 'seriously-simple-podcasting' ),
516
+			'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' ),
517 517
 			'fields'				=> array(
518 518
 				array(
519 519
 					'id' 			=> 'redirect_feed',
520
-					'label'			=> __( 'Redirect podcast feed to new URL', 'seriously-simple-podcasting' ),
521
-					'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/>' ),
520
+					'label'			=> __ ( 'Redirect podcast feed to new URL', 'seriously-simple-podcasting' ),
521
+					'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/>' ),
522 522
 					'type'			=> 'checkbox',
523 523
 					'default'		=> '',
524 524
 					'callback'		=> 'wp_strip_all_tags',
525 525
 				),
526 526
 				array(
527 527
 					'id' 			=> 'new_feed_url',
528
-					'label'			=> __( 'New podcast feed URL', 'seriously-simple-podcasting' ),
529
-					'description'	=> __( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
528
+					'label'			=> __ ( 'New podcast feed URL', 'seriously-simple-podcasting' ),
529
+					'description'	=> __ ( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
530 530
 					'type'			=> 'text',
531 531
 					'default'		=> '',
532
-					'placeholder'	=> __( 'New feed URL', 'seriously-simple-podcasting' ),
532
+					'placeholder'	=> __ ( 'New feed URL', 'seriously-simple-podcasting' ),
533 533
 					'callback'		=> 'esc_url_raw',
534 534
 					'class'			=> 'regular-text',
535 535
 				),
536 536
 			)
537 537
 		);
538 538
 
539
-		$settings['publishing'] = array(
540
-			'title'					=> __( 'Publishing' , 'seriously-simple-podcasting' ),
541
-			'description'			=> __( 'Use these URLs to share and publish your podcast feed. These URLs will work with any podcasting service (including iTunes).' , 'seriously-simple-podcasting' ),
539
+		$settings[ 'publishing' ] = array(
540
+			'title'					=> __ ( 'Publishing', 'seriously-simple-podcasting' ),
541
+			'description'			=> __ ( 'Use these URLs to share and publish your podcast feed. These URLs will work with any podcasting service (including iTunes).', 'seriously-simple-podcasting' ),
542 542
 			'fields'				=> array(
543 543
 				array(
544 544
 					'id' 			=> 'feed_url',
545
-					'label'			=> __( 'External feed URL', 'seriously-simple-podcasting' ),
546
-					'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' ),
545
+					'label'			=> __ ( 'External feed URL', 'seriously-simple-podcasting' ),
546
+					'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' ),
547 547
 					'type'			=> 'text',
548 548
 					'default'		=> '',
549
-					'placeholder'	=> __( 'External feed URL', 'seriously-simple-podcasting' ),
549
+					'placeholder'	=> __ ( 'External feed URL', 'seriously-simple-podcasting' ),
550 550
 					'callback'		=> 'esc_url_raw',
551 551
 					'class'			=> 'regular-text',
552 552
 				),
553 553
 				array(
554 554
 					'id' 			=> 'feed_link',
555
-					'label'			=> __( 'Complete feed', 'seriously-simple-podcasting' ),
555
+					'label'			=> __ ( 'Complete feed', 'seriously-simple-podcasting' ),
556 556
 					'description'	=> '',
557 557
 					'type'			=> 'feed_link',
558 558
 					'callback'		=> 'esc_url_raw',
559 559
 				),
560 560
 				array(
561 561
 					'id' 			=> 'feed_link_series',
562
-					'label'			=> __( 'Feed for a specific series', 'seriously-simple-podcasting' ),
562
+					'label'			=> __ ( 'Feed for a specific series', 'seriously-simple-podcasting' ),
563 563
 					'description'	=> '',
564 564
 					'type'			=> 'feed_link_series',
565 565
 					'callback'		=> 'esc_url_raw',
566 566
 				),
567 567
 				array(
568 568
 					'id' 			=> 'podcast_url',
569
-					'label'			=> __( 'Podcast page', 'seriously-simple-podcasting' ),
569
+					'label'			=> __ ( 'Podcast page', 'seriously-simple-podcasting' ),
570 570
 					'description'	=> '',
571 571
 					'type'			=> 'podcast_url',
572 572
 					'callback'		=> 'esc_url_raw',
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 			)
575 575
 		);
576 576
 
577
-		$settings = apply_filters( 'ssp_settings_fields', $settings );
577
+		$settings = apply_filters ( 'ssp_settings_fields', $settings );
578 578
 
579 579
 		return $settings;
580 580
 	}
@@ -584,15 +584,15 @@  discard block
 block discarded – undo
584 584
 	 * @return void
585 585
 	 */
586 586
 	public function register_settings() {
587
-		if ( is_array( $this->settings ) ) {
587
+		if ( is_array ( $this->settings ) ) {
588 588
 
589 589
 			// Check posted/selected tab
590 590
 			$current_section = 'general';
591
-			if ( isset( $_POST['tab'] ) && $_POST['tab'] ) {
592
-				$current_section = $_POST['tab'];
591
+			if ( isset( $_POST[ 'tab' ] ) && $_POST[ 'tab' ] ) {
592
+				$current_section = $_POST[ 'tab' ];
593 593
 			} else {
594
-				if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {
595
-					$current_section = $_GET['tab'];
594
+				if ( isset( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] ) {
595
+					$current_section = $_GET[ 'tab' ];
596 596
 				}
597 597
 			}
598 598
 
@@ -607,81 +607,81 @@  discard block
 block discarded – undo
607 607
 				$series_id = 0;
608 608
 				if ( 'feed-details' == $section ) {
609 609
 
610
-					if ( isset( $_REQUEST['feed-series'] ) && $_REQUEST['feed-series'] && 'default' != $_REQUEST['feed-series'] ) {
610
+					if ( isset( $_REQUEST[ 'feed-series' ] ) && $_REQUEST[ 'feed-series' ] && 'default' != $_REQUEST[ 'feed-series' ] ) {
611 611
 
612 612
 						// Get selected series
613
-						$series = get_term_by( 'slug', esc_attr( $_REQUEST['feed-series'] ), 'series' );
613
+						$series = get_term_by ( 'slug', esc_attr ( $_REQUEST[ 'feed-series' ] ), 'series' );
614 614
 
615 615
 						// Store series ID for later use
616 616
 						$series_id = $series->term_id;
617 617
 
618 618
 						// Append series name to section title
619 619
 						if ( $series ) {
620
-							$title_tail = ': ' . $series->name;
620
+							$title_tail = ': '.$series->name;
621 621
 						}
622 622
 					}
623 623
 				}
624 624
 
625
-				$section_title = $data['title'] . $title_tail;
625
+				$section_title = $data[ 'title' ].$title_tail;
626 626
 
627 627
 				// Add section to page
628
-				add_settings_section( $section, $section_title, array( $this, 'settings_section' ), 'ss_podcasting' );
628
+				add_settings_section ( $section, $section_title, array( $this, 'settings_section' ), 'ss_podcasting' );
629 629
 
630
-				foreach ( $data['fields'] as $field ) {
630
+				foreach ( $data[ 'fields' ] as $field ) {
631 631
 
632 632
 					// Validation callback for field
633 633
 					$validation = '';
634
-					if ( isset( $field['callback'] ) ) {
635
-						$validation = $field['callback'];
634
+					if ( isset( $field[ 'callback' ] ) ) {
635
+						$validation = $field[ 'callback' ];
636 636
 					}
637 637
 
638 638
 					// Get field option name
639
-					$option_name = $this->settings_base . $field['id'];
639
+					$option_name = $this->settings_base.$field[ 'id' ];
640 640
 
641 641
 					// Append series ID if selected
642 642
 					if ( $series_id ) {
643
-						$option_name .= '_' . $series_id;
643
+						$option_name .= '_'.$series_id;
644 644
 					}
645 645
 
646 646
 					// Register setting
647
-					register_setting( 'ss_podcasting', $option_name, $validation );
647
+					register_setting ( 'ss_podcasting', $option_name, $validation );
648 648
 
649 649
 					// Add field to page
650
-					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 ) );
650
+					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 ) );
651 651
 				}
652 652
 			}
653 653
 		}
654 654
 	}
655 655
 
656 656
 	public function settings_section( $section ) {
657
-		$html = '<p>' . $this->settings[ $section['id'] ]['description'] . '</p>' . "\n";
657
+		$html = '<p>'.$this->settings[ $section[ 'id' ] ][ 'description' ].'</p>'."\n";
658 658
 
659
-		if( 'feed-details' == $section['id'] ) {
659
+		if ( 'feed-details' == $section[ 'id' ] ) {
660 660
 
661 661
 			$feed_series = 'default';
662
-			if( isset( $_GET['feed-series'] ) ) {
663
-				$feed_series = esc_attr( $_GET['feed-series'] );
662
+			if ( isset( $_GET[ 'feed-series' ] ) ) {
663
+				$feed_series = esc_attr ( $_GET[ 'feed-series' ] );
664 664
 			}
665 665
 
666
-			$permalink_structure = get_option( 'permalink_structure' );
666
+			$permalink_structure = get_option ( 'permalink_structure' );
667 667
 
668 668
 			if ( $permalink_structure ) {
669
-				$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
670
-				$feed_url = $this->home_url . 'feed/' . $feed_slug;
669
+				$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
670
+				$feed_url = $this->home_url.'feed/'.$feed_slug;
671 671
 			} else {
672
-				$feed_url = $this->home_url . '?feed=' . $this->token;
672
+				$feed_url = $this->home_url.'?feed='.$this->token;
673 673
 			}
674 674
 
675
-			if( $feed_series && $feed_series != 'default' ) {
675
+			if ( $feed_series && $feed_series != 'default' ) {
676 676
 				if ( $permalink_structure ) {
677
-					$feed_url .= '/' . $feed_series;
677
+					$feed_url .= '/'.$feed_series;
678 678
 				} else {
679
-					$feed_url .= '&podcast_series=' . $feed_series;
679
+					$feed_url .= '&podcast_series='.$feed_series;
680 680
 				}
681 681
 			}
682 682
 
683
-			if( $feed_url ) {
684
-				$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";
683
+			if ( $feed_url ) {
684
+				$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";
685 685
 			}
686 686
 
687 687
 		}
@@ -696,116 +696,116 @@  discard block
 block discarded – undo
696 696
 	 */
697 697
 	public function display_field( $args ) {
698 698
 
699
-		$field = $args['field'];
699
+		$field = $args[ 'field' ];
700 700
 
701 701
 		$html = '';
702 702
 
703 703
 		// Get option name
704
-		$option_name = $this->settings_base . $field['id'];
704
+		$option_name = $this->settings_base.$field[ 'id' ];
705 705
 		$default_option_name = $option_name;
706 706
 
707 707
 		// Get field default
708 708
 		$default = '';
709
-		if ( isset( $field['default'] ) ) {
710
-			$default = $field['default'];
709
+		if ( isset( $field[ 'default' ] ) ) {
710
+			$default = $field[ 'default' ];
711 711
 		}
712 712
 
713 713
 		// Get option value
714
-		$data = get_option( $option_name, $default );
714
+		$data = get_option ( $option_name, $default );
715 715
 
716 716
 		// Get specific series data if applicable
717
-		if ( isset( $args['feed-series'] ) && $args['feed-series'] ) {
717
+		if ( isset( $args[ 'feed-series' ] ) && $args[ 'feed-series' ] ) {
718 718
 
719 719
 			$option_default = '';
720 720
 
721 721
 			// Set placeholder to default feed option with specified default fallback
722 722
 			if ( $data ) {
723
-				$field['placeholder'] = $data;
723
+				$field[ 'placeholder' ] = $data;
724 724
 
725
-				if ( in_array( $field['type'], array( 'checkbox', 'select', 'image' ) ) ) {
725
+				if ( in_array ( $field[ 'type' ], array( 'checkbox', 'select', 'image' ) ) ) {
726 726
 					$option_default = $data;
727 727
 				}
728 728
 			}
729 729
 
730 730
 			// Append series ID to option name
731
-			$option_name .= '_' . $args['feed-series'];
731
+			$option_name .= '_'.$args[ 'feed-series' ];
732 732
 
733 733
 			// Get series-sepcific option
734
-			$data = get_option( $option_name, $option_default );
734
+			$data = get_option ( $option_name, $option_default );
735 735
 
736 736
 		}
737 737
 
738 738
 		// Get field class if supplied
739 739
 		$class = '';
740
-		if ( isset( $field['class'] ) ) {
741
-			$class = $field['class'];
740
+		if ( isset( $field[ 'class' ] ) ) {
741
+			$class = $field[ 'class' ];
742 742
 		}
743 743
 
744 744
 		// Get parent class if supplied
745 745
 		$parent_class = '';
746
-		if ( isset( $field['parent_class'] ) ) {
747
-			$parent_class = $field['parent_class'];
746
+		if ( isset( $field[ 'parent_class' ] ) ) {
747
+			$parent_class = $field[ 'parent_class' ];
748 748
 		}
749 749
 
750
-		switch( $field['type'] ) {
750
+		switch ( $field[ 'type' ] ) {
751 751
 			case 'text':
752 752
 			case 'password':
753 753
 			case 'number':
754
-				$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";
754
+				$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";
755 755
 			break;
756 756
 
757 757
 			case 'text_secret':
758
-				$placeholder = $field['placeholder'];
758
+				$placeholder = $field[ 'placeholder' ];
759 759
 				if ( $data ) {
760
-					$placeholder = __( 'Password stored securely', 'seriously-simple-podcasting' );
760
+					$placeholder = __ ( 'Password stored securely', 'seriously-simple-podcasting' );
761 761
 				}
762
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="text" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $placeholder ) . '" value="" class="' . $class . '"/>' . "\n";
762
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="text" name="'.esc_attr ( $option_name ).'" placeholder="'.esc_attr ( $placeholder ).'" value="" class="'.$class.'"/>'."\n";
763 763
 			break;
764 764
 
765 765
 			case 'textarea':
766
-				$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";
766
+				$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";
767 767
 			break;
768 768
 
769 769
 			case 'checkbox':
770 770
 				$checked = '';
771
-				if ( $data && 'on' == $data ){
771
+				if ( $data && 'on' == $data ) {
772 772
 					$checked = 'checked="checked"';
773 773
 				}
774
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="' . $field['type'] . '" name="' . esc_attr( $option_name ) . '" ' . $checked . ' class="' . $class . '"/>' . "\n";
774
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="'.$field[ 'type' ].'" name="'.esc_attr ( $option_name ).'" '.$checked.' class="'.$class.'"/>'."\n";
775 775
 			break;
776 776
 
777 777
 			case 'checkbox_multi':
778
-				foreach ( $field['options'] as $k => $v ) {
778
+				foreach ( $field[ 'options' ] as $k => $v ) {
779 779
 					$checked = false;
780
-					if ( in_array( $k, (array) $data ) ) {
780
+					if ( in_array ( $k, (array) $data ) ) {
781 781
 						$checked = true;
782 782
 					}
783
-					$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/>';
783
+					$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/>';
784 784
 				}
785 785
 			break;
786 786
 
787 787
 			case 'radio':
788
-				foreach ( $field['options'] as $k => $v ) {
788
+				foreach ( $field[ 'options' ] as $k => $v ) {
789 789
 					$checked = false;
790 790
 					if ( $k == $data ) {
791 791
 						$checked = true;
792 792
 					}
793
-					$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/>';
793
+					$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/>';
794 794
 				}
795 795
 			break;
796 796
 
797 797
 			case 'select':
798 798
 
799
-				$html .= '<select name="' . esc_attr( $option_name ) . '" id="' . esc_attr( $field['id'] ) . '" class="' . $class . '">';
799
+				$html .= '<select name="'.esc_attr ( $option_name ).'" id="'.esc_attr ( $field[ 'id' ] ).'" class="'.$class.'">';
800 800
 				$prev_group = '';
801
-				foreach ( $field['options'] as $k => $v ) {
801
+				foreach ( $field[ 'options' ] as $k => $v ) {
802 802
 
803 803
 					$group = '';
804
-					if ( is_array( $v ) ) {
805
-						if ( isset( $v['group'] ) ) {
806
-							$group = $v['group'];
804
+					if ( is_array ( $v ) ) {
805
+						if ( isset( $v[ 'group' ] ) ) {
806
+							$group = $v[ 'group' ];
807 807
 						}
808
-						$v = $v['label'];
808
+						$v = $v[ 'label' ];
809 809
 					}
810 810
 
811 811
 					if ( $prev_group && $group != $prev_group ) {
@@ -818,10 +818,10 @@  discard block
 block discarded – undo
818 818
 					}
819 819
 
820 820
 					if ( $group && $group != $prev_group ) {
821
-						$html .= '<optgroup label="' . esc_attr( $group ) . '">';
821
+						$html .= '<optgroup label="'.esc_attr ( $group ).'">';
822 822
 					}
823 823
 
824
-					$html .= '<option ' . selected( $selected, true, false ) . ' value="' . esc_attr( $k ) . '">' . esc_html( $v ) . '</option>';
824
+					$html .= '<option '.selected ( $selected, true, false ).' value="'.esc_attr ( $k ).'">'.esc_html ( $v ).'</option>';
825 825
 
826 826
 					$prev_group = $group;
827 827
 				}
@@ -829,65 +829,65 @@  discard block
 block discarded – undo
829 829
 			break;
830 830
 
831 831
 			case 'image':
832
-				$html .= '<img id="' . esc_attr( $default_option_name ) . '_preview" src="' . esc_attr( $data ) . '" style="max-width:400px;height:auto;" /><br/>' . "\n";
833
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '_button" type="button" class="button" value="'. __( 'Upload new image' , 'seriously-simple-podcasting' ) . '" />' . "\n";
834
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '_delete" type="button" class="button" value="'. __( 'Remove image' , 'seriously-simple-podcasting' ) . '" />' . "\n";
835
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '" type="hidden" name="' . esc_attr( $option_name ) . '" value="' . esc_attr( $data ) . '"/><br/>' . "\n";
832
+				$html .= '<img id="'.esc_attr ( $default_option_name ).'_preview" src="'.esc_attr ( $data ).'" style="max-width:400px;height:auto;" /><br/>'."\n";
833
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'_button" type="button" class="button" value="'.__ ( 'Upload new image', 'seriously-simple-podcasting' ).'" />'."\n";
834
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'_delete" type="button" class="button" value="'.__ ( 'Remove image', 'seriously-simple-podcasting' ).'" />'."\n";
835
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'" type="hidden" name="'.esc_attr ( $option_name ).'" value="'.esc_attr ( $data ).'"/><br/>'."\n";
836 836
 			break;
837 837
 
838 838
 			case 'feed_link':
839 839
 
840 840
 				// Set feed URL based on site's permalink structure
841
-				if ( get_option( 'permalink_structure' ) ) {
842
-					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
843
-					$url = $this->home_url . 'feed/' . $feed_slug;
841
+				if ( get_option ( 'permalink_structure' ) ) {
842
+					$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
843
+					$url = $this->home_url.'feed/'.$feed_slug;
844 844
 				} else {
845
-					$url = $this->home_url . '?feed=' . $this->token;
845
+					$url = $this->home_url.'?feed='.$this->token;
846 846
 				}
847 847
 
848
-				$html .= '<a href="' . esc_url( $url ) . '" target="_blank">' . $url . '</a>';
848
+				$html .= '<a href="'.esc_url ( $url ).'" target="_blank">'.$url.'</a>';
849 849
 			break;
850 850
 
851 851
 			case 'feed_link_series':
852 852
 
853 853
 				// Set feed URL based on site's permalink structure
854
-				if ( get_option( 'permalink_structure' ) ) {
855
-					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
856
-					$url = $this->home_url . 'feed/' . $feed_slug . '/series-slug';
854
+				if ( get_option ( 'permalink_structure' ) ) {
855
+					$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
856
+					$url = $this->home_url.'feed/'.$feed_slug.'/series-slug';
857 857
 				} else {
858
-					$url = $this->home_url . '?feed=' . $this->token . '&podcast_series=series-slug';
858
+					$url = $this->home_url.'?feed='.$this->token.'&podcast_series=series-slug';
859 859
 				}
860 860
 
861
-				$html .= esc_url( $url ) . "\n";
861
+				$html .= esc_url ( $url )."\n";
862 862
 			break;
863 863
 
864 864
 			case 'podcast_url';
865 865
 
866
-				$slug = apply_filters( 'ssp_archive_slug', __( 'podcast' , 'seriously-simple-podcasting' ) );
867
-				$podcast_url = $this->home_url . $slug;
866
+				$slug = apply_filters ( 'ssp_archive_slug', __ ( 'podcast', 'seriously-simple-podcasting' ) );
867
+				$podcast_url = $this->home_url.$slug;
868 868
 
869
-				$html .= '<a href="' . esc_url( $podcast_url ) . '" target="_blank">' . $podcast_url . '</a>';
869
+				$html .= '<a href="'.esc_url ( $podcast_url ).'" target="_blank">'.$podcast_url.'</a>';
870 870
 			break;
871 871
 
872 872
 		}
873 873
 
874
-		if ( ! in_array( $field['type'], array( 'feed_link', 'feed_link_series', 'podcast_url' ) ) ) {
875
-			switch( $field['type'] ) {
874
+		if ( ! in_array ( $field[ 'type' ], array( 'feed_link', 'feed_link_series', 'podcast_url' ) ) ) {
875
+			switch ( $field[ 'type' ] ) {
876 876
 
877 877
 				case 'checkbox_multi':
878 878
 				case 'radio':
879 879
 				case 'select_multi':
880
-					$html .= '<br/><span class="description">' . esc_attr( $field['description'] ) . '</span>';
880
+					$html .= '<br/><span class="description">'.esc_attr ( $field[ 'description' ] ).'</span>';
881 881
 				break;
882 882
 
883 883
 				default:
884
-					$html .= '<label for="' . esc_attr( $field['id'] ) . '"><span class="description">' . wp_kses_post( $field['description'] ) . '</span></label>' . "\n";
884
+					$html .= '<label for="'.esc_attr ( $field[ 'id' ] ).'"><span class="description">'.wp_kses_post ( $field[ 'description' ] ).'</span></label>'."\n";
885 885
 				break;
886 886
 			}
887 887
 		}
888 888
 
889
-		if( $parent_class ) {
890
-			$html = '<div class="' . $parent_class . '">' . $html . '</div>';
889
+		if ( $parent_class ) {
890
+			$html = '<div class="'.$parent_class.'">'.$html.'</div>';
891 891
 		}
892 892
 
893 893
 		echo $html;
@@ -899,8 +899,8 @@  discard block
 block discarded – undo
899 899
 	 * @return string       Validated string
900 900
 	 */
901 901
 	public function validate_slug( $slug ) {
902
-		if ( $slug && strlen( $slug ) > 0 && $slug != '' ) {
903
-			$slug = urlencode( strtolower( str_replace( ' ' , '-' , $slug ) ) );
902
+		if ( $slug && strlen ( $slug ) > 0 && $slug != '' ) {
903
+			$slug = urlencode ( strtolower ( str_replace ( ' ', '-', $slug ) ) );
904 904
 		}
905 905
 		return $slug;
906 906
 	}
@@ -912,10 +912,10 @@  discard block
 block discarded – undo
912 912
 	 */
913 913
 	public function encode_password( $password ) {
914 914
 
915
-		if ( $password && strlen( $password ) > 0 && $password != '' ) {
916
-			$password = md5( $password );
915
+		if ( $password && strlen ( $password ) > 0 && $password != '' ) {
916
+			$password = md5 ( $password );
917 917
 		} else {
918
-			$option = get_option( 'ss_podcasting_protection_password' );
918
+			$option = get_option ( 'ss_podcasting_protection_password' );
919 919
 			$password = $option;
920 920
 		}
921 921
 
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 			    'p' => array()
944 944
 			);
945 945
 
946
-			$message = wp_kses( $message, $allowed );
946
+			$message = wp_kses ( $message, $allowed );
947 947
 		}
948 948
 
949 949
 		return $message;
@@ -960,8 +960,8 @@  discard block
 block discarded – undo
960 960
 
961 961
 		if ( $option == 'ss_podcasting_redirect_feed' ) {
962 962
 			if ( ( $new_value != $old_value ) && $new_value == 'on' ) {
963
-				$date = time();
964
-				update_option( 'ss_podcasting_redirect_feed_date', $date );
963
+				$date = time ();
964
+				update_option ( 'ss_podcasting_redirect_feed_date', $date );
965 965
 			}
966 966
 		}
967 967
 
@@ -974,64 +974,64 @@  discard block
 block discarded – undo
974 974
 	public function settings_page() {
975 975
 
976 976
 		// Build page HTML
977
-		$html = '<div class="wrap" id="podcast_settings">' . "\n";
978
-			$html .= '<h1>' . __( 'Podcast Settings' , 'seriously-simple-podcasting' ) . '</h1>' . "\n";
977
+		$html = '<div class="wrap" id="podcast_settings">'."\n";
978
+			$html .= '<h1>'.__ ( 'Podcast Settings', 'seriously-simple-podcasting' ).'</h1>'."\n";
979 979
 
980 980
 			$tab = 'general';
981
-			if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {
982
-				$tab = $_GET['tab'];
981
+			if ( isset( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] ) {
982
+				$tab = $_GET[ 'tab' ];
983 983
 			}
984 984
 
985 985
 			// Show page tabs
986
-			if ( is_array( $this->settings ) && 1 < count( $this->settings ) ) {
986
+			if ( is_array ( $this->settings ) && 1 < count ( $this->settings ) ) {
987 987
 
988
-				$html .= '<h2 class="nav-tab-wrapper">' . "\n";
988
+				$html .= '<h2 class="nav-tab-wrapper">'."\n";
989 989
 
990 990
 				$c = 0;
991 991
 				foreach ( $this->settings as $section => $data ) {
992 992
 
993 993
 					// Set tab class
994 994
 					$class = 'nav-tab';
995
-					if ( ! isset( $_GET['tab'] ) ) {
995
+					if ( ! isset( $_GET[ 'tab' ] ) ) {
996 996
 						if ( 0 == $c ) {
997 997
 							$class .= ' nav-tab-active';
998 998
 						}
999 999
 					} else {
1000
-						if ( isset( $_GET['tab'] ) && $section == $_GET['tab'] ) {
1000
+						if ( isset( $_GET[ 'tab' ] ) && $section == $_GET[ 'tab' ] ) {
1001 1001
 							$class .= ' nav-tab-active';
1002 1002
 						}
1003 1003
 					}
1004 1004
 
1005 1005
 					// Set tab link
1006
-					$tab_link = add_query_arg( array( 'tab' => $section ) );
1007
-					if ( isset( $_GET['settings-updated'] ) ) {
1008
-						$tab_link = remove_query_arg( 'settings-updated', $tab_link );
1006
+					$tab_link = add_query_arg ( array( 'tab' => $section ) );
1007
+					if ( isset( $_GET[ 'settings-updated' ] ) ) {
1008
+						$tab_link = remove_query_arg ( 'settings-updated', $tab_link );
1009 1009
 					}
1010 1010
 
1011
-					if ( isset( $_GET['feed-series'] ) ) {
1012
-						$tab_link = remove_query_arg( 'feed-series', $tab_link );
1011
+					if ( isset( $_GET[ 'feed-series' ] ) ) {
1012
+						$tab_link = remove_query_arg ( 'feed-series', $tab_link );
1013 1013
 					}
1014 1014
 
1015 1015
 					// Output tab
1016
-					$html .= '<a href="' . esc_url( $tab_link ) . '" class="' . esc_attr( $class ) . '">' . esc_html( $data['title'] ) . '</a>' . "\n";
1016
+					$html .= '<a href="'.esc_url ( $tab_link ).'" class="'.esc_attr ( $class ).'">'.esc_html ( $data[ 'title' ] ).'</a>'."\n";
1017 1017
 
1018 1018
 					++$c;
1019 1019
 				}
1020 1020
 
1021
-				$html .= '</h2>' . "\n";
1021
+				$html .= '</h2>'."\n";
1022 1022
 			}
1023 1023
 
1024
-			if ( isset( $_GET['settings-updated'] ) ) {
1024
+			if ( isset( $_GET[ 'settings-updated' ] ) ) {
1025 1025
 				$html .= '<br/><div class="updated notice notice-success is-dismissible">
1026
-					        <p>' . sprintf( __( '%1$s settings updated.', 'seriously-simple-podcasting' ), '<b>' . str_replace( '-', ' ', ucfirst( $tab ) ) . '</b>' ) . '</p>
1026
+					        <p>' . sprintf ( __ ( '%1$s settings updated.', 'seriously-simple-podcasting' ), '<b>'.str_replace ( '-', ' ', ucfirst ( $tab ) ).'</b>' ).'</p>
1027 1027
 					    </div>';
1028 1028
 			}
1029 1029
 
1030
-			if( function_exists( 'php_sapi_name') && 'security' == $tab ) {
1031
-				$sapi_type = php_sapi_name();
1032
-				if ( strpos( $sapi_type, 'fcgi' ) !== false ) {
1030
+			if ( function_exists ( 'php_sapi_name' ) && 'security' == $tab ) {
1031
+				$sapi_type = php_sapi_name ();
1032
+				if ( strpos ( $sapi_type, 'fcgi' ) !== false ) {
1033 1033
 				    $html .= '<br/><div class="update-nag">
1034
-					        <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>
1034
+					        <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>
1035 1035
 					    </div>';
1036 1036
 				}
1037 1037
 			}
@@ -1040,23 +1040,23 @@  discard block
 block discarded – undo
1040 1040
 
1041 1041
 			// Series submenu for feed details
1042 1042
 			if ( 'feed-details' == $tab ) {
1043
-				$series = get_terms( 'series', array( 'hide_empty' => false ) );
1043
+				$series = get_terms ( 'series', array( 'hide_empty' => false ) );
1044 1044
 
1045 1045
 				if ( ! empty( $series ) ) {
1046 1046
 
1047
-					if ( isset( $_GET['feed-series'] ) && $_GET['feed-series'] && 'default' != $_GET['feed-series'] ) {
1048
-						$current_series = esc_attr( $_GET['feed-series'] );
1047
+					if ( isset( $_GET[ 'feed-series' ] ) && $_GET[ 'feed-series' ] && 'default' != $_GET[ 'feed-series' ] ) {
1048
+						$current_series = esc_attr ( $_GET[ 'feed-series' ] );
1049 1049
 						$series_class = '';
1050 1050
 					} else {
1051 1051
 						$current_series = 'default';
1052 1052
 						$series_class = 'current';
1053 1053
 					}
1054 1054
 
1055
-					$html .= '<div class="feed-series-list-container">' . "\n";
1056
-						$html .= '<span id="feed-series-toggle" class="series-open" title="' . __( 'Toggle series list display', 'seriously-simple-podcasting' ) . '"></span>' . "\n";
1055
+					$html .= '<div class="feed-series-list-container">'."\n";
1056
+						$html .= '<span id="feed-series-toggle" class="series-open" title="'.__ ( 'Toggle series list display', 'seriously-simple-podcasting' ).'"></span>'."\n";
1057 1057
 
1058
-						$html .= '<ul id="feed-series-list" class="subsubsub series-open">' . "\n";
1059
-							$html .= '<li><a href="' . add_query_arg( array( 'feed-series' => 'default', 'settings-updated' => false ) ) . '" class="' . $series_class . '">' . __( 'Default feed', 'seriously-simple-podcasting' ) . '</a></li>';
1058
+						$html .= '<ul id="feed-series-list" class="subsubsub series-open">'."\n";
1059
+							$html .= '<li><a href="'.add_query_arg ( array( 'feed-series' => 'default', 'settings-updated' => false ) ).'" class="'.$series_class.'">'.__ ( 'Default feed', 'seriously-simple-podcasting' ).'</a></li>';
1060 1060
 
1061 1061
 							foreach ( $series as $s ) {
1062 1062
 
@@ -1066,39 +1066,39 @@  discard block
 block discarded – undo
1066 1066
 									$series_class = '';
1067 1067
 								}
1068 1068
 
1069
-								$html .= '<li>' . "\n";
1070
-									$html .= ' | <a href="' . esc_url( add_query_arg( array( 'feed-series' => $s->slug, 'settings-updated' => false ) ) ) . '" class="' . $series_class . '">' . $s->name . '</a>' . "\n";
1071
-								$html .= '</li>' . "\n";
1069
+								$html .= '<li>'."\n";
1070
+									$html .= ' | <a href="'.esc_url ( add_query_arg ( array( 'feed-series' => $s->slug, 'settings-updated' => false ) ) ).'" class="'.$series_class.'">'.$s->name.'</a>'."\n";
1071
+								$html .= '</li>'."\n";
1072 1072
 							}
1073 1073
 
1074
-						$html .= '</ul>' . "\n";
1075
-						$html .= '<br class="clear" />' . "\n";
1076
-					$html .= '</div>' . "\n";
1074
+						$html .= '</ul>'."\n";
1075
+						$html .= '<br class="clear" />'."\n";
1076
+					$html .= '</div>'."\n";
1077 1077
 
1078 1078
 				}
1079 1079
 			}
1080 1080
 
1081
-			$html .= '<form method="post" action="options.php" enctype="multipart/form-data">' . "\n";
1081
+			$html .= '<form method="post" action="options.php" enctype="multipart/form-data">'."\n";
1082 1082
 
1083 1083
 				// Add current series to posted data
1084 1084
 				if ( $current_series ) {
1085
-					$html .= '<input type="hidden" name="feed-series" value="' . esc_attr( $current_series ) . '" />' . "\n";
1085
+					$html .= '<input type="hidden" name="feed-series" value="'.esc_attr ( $current_series ).'" />'."\n";
1086 1086
 				}
1087 1087
 
1088 1088
 				// Get settings fields
1089
-				ob_start();
1090
-				settings_fields( 'ss_podcasting' );
1091
-				do_settings_sections( 'ss_podcasting' );
1092
-				$html .= ob_get_clean();
1089
+				ob_start ();
1090
+				settings_fields ( 'ss_podcasting' );
1091
+				do_settings_sections ( 'ss_podcasting' );
1092
+				$html .= ob_get_clean ();
1093 1093
 
1094 1094
 				// Submit button
1095
-				$html .= '<p class="submit">' . "\n";
1096
-					$html .= '<input type="hidden" name="tab" value="' . esc_attr( $tab ) . '" />' . "\n";
1097
-					$html .= '<input name="Submit" type="submit" class="button-primary" value="' . esc_attr( __( 'Save Settings' , 'seriously-simple-podcasting' ) ) . '" />' . "\n";
1098
-				$html .= '</p>' . "\n";
1095
+				$html .= '<p class="submit">'."\n";
1096
+					$html .= '<input type="hidden" name="tab" value="'.esc_attr ( $tab ).'" />'."\n";
1097
+					$html .= '<input name="Submit" type="submit" class="button-primary" value="'.esc_attr ( __ ( 'Save Settings', 'seriously-simple-podcasting' ) ).'" />'."\n";
1098
+				$html .= '</p>'."\n";
1099 1099
 
1100
-			$html .= '</form>' . "\n";
1101
-		$html .= '</div>' . "\n";
1100
+			$html .= '</form>'."\n";
1101
+		$html .= '</div>'."\n";
1102 1102
 
1103 1103
 	  	echo $html;
1104 1104
 	}
Please login to merge, or discard this patch.
includes/ssp-functions.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 	 * @since  	 1.0.0
407 407
 	 * @return   mixed
408 408
 	 */
409
-    function ssp_readfile_chunked( $file, $retbytes = true ) {
409
+	function ssp_readfile_chunked( $file, $retbytes = true ) {
410 410
 
411 411
 		$chunksize = 1 * ( 1024 * 1024 );
412 412
 		$cnt = 0;
@@ -434,5 +434,5 @@  discard block
 block discarded – undo
434 434
 		}
435 435
 
436 436
 		return $status;
437
-    }
437
+	}
438 438
 }
439 439
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,9 @@
 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 ) ) {
131
+						continue;
132
+					}
131 133
 
132 134
 					$template = $tpl;
133 135
 					$i++;
Please login to merge, or discard this 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/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.
includes/class-ssp-frontend.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -1134,6 +1134,7 @@
 block discarded – undo
1134 1134
 	 * returns the original URL
1135 1135
 	 *
1136 1136
 	 * @param    string    file
1137
+	 * @param string $file
1137 1138
 	 * @return   string    file or local file path
1138 1139
 	 */
1139 1140
 	function get_local_file_path( $file ) {
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -558,11 +558,11 @@  discard block
 block discarded – undo
558 558
 
559 559
 		if ( $size ) {
560 560
 
561
-		    $base = log ( $size ) / log( 1024 );
562
-		    $suffixes = array( '' , 'k' , 'M' , 'G' , 'T' );
563
-		    $formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ];
561
+			$base = log ( $size ) / log( 1024 );
562
+			$suffixes = array( '' , 'k' , 'M' , 'G' , 'T' );
563
+			$formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ];
564 564
 
565
-		    return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size );
565
+			return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size );
566 566
 		}
567 567
 
568 568
 		return false;
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 				wp_cache_set( $key, $mime, 'mime-type', DAY_IN_SECONDS );
665 665
 			}
666 666
 
667
-		    return $mime;
667
+			return $mime;
668 668
 		}
669 669
 
670 670
 		return false;
@@ -798,15 +798,15 @@  discard block
 block discarded – undo
798 798
 				foreach ( $terms as $term ) {
799 799
 					$query[ $term->term_id ] = new stdClass();
800 800
 					$query[ $term->term_id ]->title = $term->name;
801
-		    		$query[ $term->term_id ]->url = get_term_link( $term );
801
+					$query[ $term->term_id ]->url = get_term_link( $term );
802 802
 
803
-		    		$query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) );
803
+					$query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) );
804 804
 
805
-		    		$posts = get_posts( $query_args );
805
+					$posts = get_posts( $query_args );
806 806
 
807
-		    		$count = count( $posts );
808
-		    		$query[ $term->term_id ]->count = $count;
809
-			    }
807
+					$count = count( $posts );
808
+					$query[ $term->term_id ]->count = $count;
809
+				}
810 810
 			}
811 811
 
812 812
 		}
@@ -917,18 +917,18 @@  discard block
 block discarded – undo
917 917
 				}
918 918
 
919 919
 				// Allow other actions - functions hooked on here must not output any data
920
-			    do_action( 'ssp_file_download', $file, $episode, $referrer );
920
+				do_action( 'ssp_file_download', $file, $episode, $referrer );
921 921
 
922
-			    // Set necessary headers
922
+				// Set necessary headers
923 923
 				header( "Pragma: no-cache" );
924 924
 				header( "Expires: 0" );
925 925
 				header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
926 926
 				header( "Robots: none" );
927 927
 
928
-		        // Check file referrer
929
-		        if( 'download' == $referrer ) {
928
+				// Check file referrer
929
+				if( 'download' == $referrer ) {
930 930
 
931
-		        	// Set size of file
931
+					// Set size of file
932 932
 					// Do we have anything in Cache/DB?
933 933
 					$size = wp_cache_get( $episode_id, 'filesize_raw' );
934 934
 
@@ -955,22 +955,22 @@  discard block
 block discarded – undo
955 955
 					}
956 956
 
957 957
 					// Send Content-Length header
958
-		        	if ( ! empty( $size ) ) {
958
+					if ( ! empty( $size ) ) {
959 959
 						header( "Content-Length: " . $size );
960 960
 					}
961 961
 
962
-		        	// Force file download
963
-		        	header( "Content-Type: application/force-download" );
962
+					// Force file download
963
+					header( "Content-Type: application/force-download" );
964 964
 
965
-			        // Set other relevant headers
966
-			        header( "Content-Description: File Transfer" );
967
-			        header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" );
968
-			        header( "Content-Transfer-Encoding: binary" );
965
+					// Set other relevant headers
966
+					header( "Content-Description: File Transfer" );
967
+					header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" );
968
+					header( "Content-Transfer-Encoding: binary" );
969 969
 
970
-			        // Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
970
+					// Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
971 971
 					$file = str_replace( ' ', '%20', $file );
972 972
 
973
-			        // Use ssp_readfile_chunked() if allowed on the server or simply access file directly
973
+					// Use ssp_readfile_chunked() if allowed on the server or simply access file directly
974 974
 					@ssp_readfile_chunked( $file ) or header( 'Location: ' . $file );
975 975
 				} else {
976 976
 
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 						if ( get_option( 'permalink_structure' ) ) {
1151 1151
 							$file = $this->get_episode_download_link( $episode_id );
1152 1152
 						}
1153
-		    			$html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n";
1153
+						$html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n";
1154 1154
 					break;
1155 1155
 
1156 1156
 					case 'details':
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
 
1166 1166
 		$html .= '</div>' . "\n";
1167 1167
 
1168
-	    return $html;
1168
+		return $html;
1169 1169
 	}
1170 1170
 
1171 1171
 	/**
Please login to merge, or discard this patch.
Spacing   +297 added lines, -297 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
 
@@ -33,57 +33,57 @@  discard block
 block discarded – undo
33 33
 
34 34
 		$this->version = $version;
35 35
 
36
-		$this->dir = dirname( $file );
36
+		$this->dir = dirname ( $file );
37 37
 		$this->file = $file;
38
-		$this->assets_dir = trailingslashit( $this->dir ) . 'assets';
39
-		$this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $file ) ) );
40
-		$this->template_path = trailingslashit( $this->dir ) . 'templates/';
41
-		$this->template_url = esc_url( trailingslashit( plugins_url( '/templates/', $file ) ) );
42
-		$this->home_url = trailingslashit( home_url() );
43
-		$this->site_url = trailingslashit( site_url() );
38
+		$this->assets_dir = trailingslashit ( $this->dir ).'assets';
39
+		$this->assets_url = esc_url ( trailingslashit ( plugins_url ( '/assets/', $file ) ) );
40
+		$this->template_path = trailingslashit ( $this->dir ).'templates/';
41
+		$this->template_url = esc_url ( trailingslashit ( plugins_url ( '/templates/', $file ) ) );
42
+		$this->home_url = trailingslashit ( home_url () );
43
+		$this->site_url = trailingslashit ( site_url () );
44 44
 		$this->token = 'podcast';
45 45
 
46 46
 		// Add meta data to start of podcast content
47
-		$locations = get_option( 'ss_podcasting_player_locations', array() );
47
+		$locations = get_option ( 'ss_podcasting_player_locations', array() );
48 48
 
49
-		if ( in_array( 'content', (array) $locations ) ) {
50
-			add_filter( 'the_content', array( $this, 'content_meta_data' ), 10, 1 );
49
+		if ( in_array ( 'content', (array) $locations ) ) {
50
+			add_filter ( 'the_content', array( $this, 'content_meta_data' ), 10, 1 );
51 51
 		}
52 52
 
53
-		if ( in_array( 'excerpt', (array) $locations ) ) {
54
-			add_filter( 'the_excerpt', array( $this, 'get_excerpt_meta_data' ), 10, 1 );
53
+		if ( in_array ( 'excerpt', (array) $locations ) ) {
54
+			add_filter ( 'the_excerpt', array( $this, 'get_excerpt_meta_data' ), 10, 1 );
55 55
 		}
56 56
 
57
-		if ( in_array( 'excerpt_embed', (array) $locations ) ) {
58
-			add_filter( 'the_excerpt_embed', array( $this, 'get_embed_meta_data' ), 10, 1 );
57
+		if ( in_array ( 'excerpt_embed', (array) $locations ) ) {
58
+			add_filter ( 'the_excerpt_embed', array( $this, 'get_embed_meta_data' ), 10, 1 );
59 59
 		}
60 60
 
61 61
 		// Add SSP label and version to generator tags
62
-		add_action( 'get_the_generator_html', array( $this, 'generator_tag' ), 10, 2 );
63
-		add_action( 'get_the_generator_xhtml', array( $this, 'generator_tag' ), 10, 2 );
62
+		add_action ( 'get_the_generator_html', array( $this, 'generator_tag' ), 10, 2 );
63
+		add_action ( 'get_the_generator_xhtml', array( $this, 'generator_tag' ), 10, 2 );
64 64
 
65 65
 		// Add RSS meta tag to site header
66
-		add_action( 'wp_head' , array( $this, 'rss_meta_tag' ) );
66
+		add_action ( 'wp_head', array( $this, 'rss_meta_tag' ) );
67 67
 
68 68
 		// Add podcast episode to main query loop if setting is activated
69
-		add_action( 'pre_get_posts' , array( $this, 'add_to_home_query' ) );
69
+		add_action ( 'pre_get_posts', array( $this, 'add_to_home_query' ) );
70 70
 
71 71
 		// Make sure to fetch all relevant post types when viewing series archive
72
-		add_action( 'pre_get_posts' , array( $this, 'add_all_post_types' ) );
72
+		add_action ( 'pre_get_posts', array( $this, 'add_all_post_types' ) );
73 73
 
74 74
 		// Download podcast episode
75
-		add_action( 'wp', array( $this, 'download_file' ), 1 );
75
+		add_action ( 'wp', array( $this, 'download_file' ), 1 );
76 76
 
77 77
 		// Register widgets
78
-		add_action( 'widgets_init', array( $this, 'register_widgets' ), 1 );
78
+		add_action ( 'widgets_init', array( $this, 'register_widgets' ), 1 );
79 79
 
80 80
 		// Add shortcodes
81
-		add_action( 'init', array( $this, 'register_shortcodes' ), 1 );
81
+		add_action ( 'init', array( $this, 'register_shortcodes' ), 1 );
82 82
 
83
-		add_filter( 'feed_content_type', array( $this, 'feed_content_type' ), 10, 2 );
83
+		add_filter ( 'feed_content_type', array( $this, 'feed_content_type' ), 10, 2 );
84 84
 
85 85
 		// Handle localisation
86
-		add_action( 'plugins_loaded', array( $this, 'load_localisation' ) );
86
+		add_action ( 'plugins_loaded', array( $this, 'load_localisation' ) );
87 87
 	}
88 88
 
89 89
 	/**
@@ -94,36 +94,36 @@  discard block
 block discarded – undo
94 94
 	public function get_episode_download_link( $episode_id, $referrer = '' ) {
95 95
 
96 96
 		// Get file URL
97
-		$file = $this->get_enclosure( $episode_id );
97
+		$file = $this->get_enclosure ( $episode_id );
98 98
 
99 99
 		if ( ! $file ) {
100 100
 			return;
101 101
 		}
102 102
 
103 103
 		// Get download link based on permalink structure
104
-		if ( get_option( 'permalink_structure' ) ) {
105
-			$episode = get_post( $episode_id );
104
+		if ( get_option ( 'permalink_structure' ) ) {
105
+			$episode = get_post ( $episode_id );
106 106
 
107 107
 			// Get file extension - default to MP3 to prevent empty extension strings
108
-			$ext = pathinfo( $file, PATHINFO_EXTENSION );
109
-			if( ! $ext ) {
108
+			$ext = pathinfo ( $file, PATHINFO_EXTENSION );
109
+			if ( ! $ext ) {
110 110
 				$ext = 'mp3';
111 111
 			}
112 112
 
113
-			$link = $this->home_url . 'podcast-download/' . $episode_id . '/' . $episode->post_name . '.' . $ext;
113
+			$link = $this->home_url.'podcast-download/'.$episode_id.'/'.$episode->post_name.'.'.$ext;
114 114
 		} else {
115
-			$link = add_query_arg( array( 'podcast_episode' => $episode_id ), $this->home_url );
115
+			$link = add_query_arg ( array( 'podcast_episode' => $episode_id ), $this->home_url );
116 116
 		}
117 117
 
118 118
 		// Allow for dyamic referrer
119
-		$referrer = apply_filters( 'ssp_download_referrer', $referrer, $episode_id );
119
+		$referrer = apply_filters ( 'ssp_download_referrer', $referrer, $episode_id );
120 120
 
121 121
 		// Add referrer flag if supplied
122 122
 		if ( $referrer ) {
123
-			$link = add_query_arg( array( 'ref' => $referrer ), $link );
123
+			$link = add_query_arg ( array( 'ref' => $referrer ), $link );
124 124
 		}
125 125
 
126
-		return apply_filters( 'ssp_episode_download_link', esc_url( $link ), $episode_id, $file );
126
+		return apply_filters ( 'ssp_episode_download_link', esc_url ( $link ), $episode_id, $file );
127 127
 	}
128 128
 
129 129
 	/**
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
 	 */
134 134
 	public function get_episode_type( $episode_id = 0 ) {
135 135
 
136
-		if( ! $episode_id ) {
136
+		if ( ! $episode_id ) {
137 137
 			return false;
138 138
 		}
139 139
 
140
-		$type = get_post_meta( $episode_id , 'episode_type' , true );
140
+		$type = get_post_meta ( $episode_id, 'episode_type', true );
141 141
 
142
-		if( ! $type ) {
142
+		if ( ! $type ) {
143 143
 			$type = 'audio';
144 144
 		}
145 145
 
@@ -155,32 +155,32 @@  discard block
 block discarded – undo
155 155
 		global $post, $wp_current_filter, $episode_context;
156 156
 
157 157
 		// Don't output unformatted data on excerpts
158
-		if ( in_array( 'get_the_excerpt', (array) $wp_current_filter ) ) {
158
+		if ( in_array ( 'get_the_excerpt', (array) $wp_current_filter ) ) {
159 159
 			return $content;
160 160
 		}
161 161
 
162 162
 		// Don't output episode meta in shortcode or widget
163
-		if ( isset( $episode_context ) && in_array( $episode_context, array( 'shortcode', 'widget' ) ) ) {
163
+		if ( isset( $episode_context ) && in_array ( $episode_context, array( 'shortcode', 'widget' ) ) ) {
164 164
 			return $content;
165 165
 		}
166 166
 
167
-		if( post_password_required( $post->ID ) ) {
167
+		if ( post_password_required ( $post->ID ) ) {
168 168
 			return $content;
169 169
 		}
170 170
 
171
-		$podcast_post_types = ssp_post_types( true );
171
+		$podcast_post_types = ssp_post_types ( true );
172 172
 
173
-		if ( in_array( $post->post_type, $podcast_post_types ) && ! is_feed() && ! isset( $_GET['feed'] ) ) {
173
+		if ( in_array ( $post->post_type, $podcast_post_types ) && ! is_feed () && ! isset( $_GET[ 'feed' ] ) ) {
174 174
 
175 175
 			// Get episode meta data
176
-			$meta = $this->episode_meta( $post->ID, 'content' );
176
+			$meta = $this->episode_meta ( $post->ID, 'content' );
177 177
 
178 178
 			// Get specified player position
179
-			$player_position = get_option( 'ss_podcasting_player_content_location', 'above' );
179
+			$player_position = get_option ( 'ss_podcasting_player_content_location', 'above' );
180 180
 
181
-			switch( $player_position ) {
182
-				case 'above': $content = $meta . $content; break;
183
-				case 'below': $content = $content . $meta; break;
181
+			switch ( $player_position ) {
182
+				case 'above': $content = $meta.$content; break;
183
+				case 'below': $content = $content.$meta; break;
184 184
 			}
185 185
 
186 186
 		}
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	 * @return string          Modified excerpt
195 195
 	 */
196 196
 	public function get_excerpt_meta_data( $excerpt = '' ) {
197
-		return $this->excerpt_meta_data( $excerpt, 'excerpt' );
197
+		return $this->excerpt_meta_data ( $excerpt, 'excerpt' );
198 198
 	}
199 199
 
200 200
 	/**
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	 * @return string          Modified excerpt
204 204
 	 */
205 205
 	public function get_embed_meta_data( $excerpt = '' ) {
206
-		return $this->excerpt_meta_data( $excerpt, 'embed' );
206
+		return $this->excerpt_meta_data ( $excerpt, 'embed' );
207 207
 	}
208 208
 
209 209
 	/**
@@ -214,17 +214,17 @@  discard block
 block discarded – undo
214 214
 	public function excerpt_meta_data( $excerpt = '', $content = 'excerpt' ) {
215 215
 		global $post;
216 216
 
217
-		if( post_password_required( $post->ID ) ) {
217
+		if ( post_password_required ( $post->ID ) ) {
218 218
 			return $excerpt;
219 219
 		}
220 220
 
221
-		$podcast_post_types = ssp_post_types( true );
221
+		$podcast_post_types = ssp_post_types ( true );
222 222
 
223
-		if ( ( in_array( $post->post_type, $podcast_post_types ) ) && ! is_feed() ) {
223
+		if ( ( in_array ( $post->post_type, $podcast_post_types ) ) && ! is_feed () ) {
224 224
 
225
-			$meta = $this->episode_meta( $post->ID, $content );
225
+			$meta = $this->episode_meta ( $post->ID, $content );
226 226
 
227
-			$excerpt = $meta . $excerpt;
227
+			$excerpt = $meta.$excerpt;
228 228
 
229 229
 		}
230 230
 
@@ -245,34 +245,34 @@  discard block
 block discarded – undo
245 245
 			return $meta;
246 246
 		}
247 247
 
248
-		$file = $this->get_enclosure( $episode_id );
248
+		$file = $this->get_enclosure ( $episode_id );
249 249
 
250 250
 		if ( $file ) {
251 251
 
252
-			if ( get_option( 'permalink_structure' ) ) {
253
-				$file = $this->get_episode_download_link( $episode_id );
252
+			if ( get_option ( 'permalink_structure' ) ) {
253
+				$file = $this->get_episode_download_link ( $episode_id );
254 254
 			}
255 255
 
256 256
 			// Hide audio player in `ss_podcast` shortcode by default
257 257
 			$show_player = true;
258
-			if( 'shortcode' == $context ) {
258
+			if ( 'shortcode' == $context ) {
259 259
 				$show_player = false;
260 260
 			}
261 261
 
262 262
 			// Allow media player to be dynamically hidden/displayed
263
-			$show_player = apply_filters( 'ssp_show_media_player', $show_player, $context );
263
+			$show_player = apply_filters ( 'ssp_show_media_player', $show_player, $context );
264 264
 
265 265
 			// Show audio player if requested
266
-			if( $show_player ) {
267
-				$meta .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>';
266
+			if ( $show_player ) {
267
+				$meta .= '<div class="podcast_player">'.$this->media_player ( $file, $episode_id ).'</div>';
268 268
 			}
269 269
 
270
-			if ( apply_filters( 'ssp_show_episode_details', true, $episode_id, $context ) ) {
271
-				$meta .= $this->episode_meta_details( $episode_id, $context );
270
+			if ( apply_filters ( 'ssp_show_episode_details', true, $episode_id, $context ) ) {
271
+				$meta .= $this->episode_meta_details ( $episode_id, $context );
272 272
 			}
273 273
 		}
274 274
 
275
-		$meta = apply_filters( 'ssp_episode_meta', $meta, $episode_id, $context );
275
+		$meta = apply_filters ( 'ssp_episode_meta', $meta, $episode_id, $context );
276 276
 
277 277
 		return $meta;
278 278
 	}
@@ -283,36 +283,36 @@  discard block
 block discarded – undo
283 283
 	 * @param  string  $context    Context for display
284 284
 	 * @return string              Episode meta details
285 285
 	 */
286
-	public function episode_meta_details ( $episode_id = 0, $context = 'content' ) {
286
+	public function episode_meta_details( $episode_id = 0, $context = 'content' ) {
287 287
 
288 288
 		if ( ! $episode_id ) {
289 289
 			return;
290 290
 		}
291 291
 
292
-		$file = $this->get_enclosure( $episode_id );
292
+		$file = $this->get_enclosure ( $episode_id );
293 293
 
294 294
 		if ( ! $file ) {
295 295
 			return;
296 296
 		}
297 297
 
298
-		$link = $this->get_episode_download_link( $episode_id, 'download' );
299
-		$duration = get_post_meta( $episode_id , 'duration' , true );
300
-		$size = get_post_meta( $episode_id , 'filesize' , true );
298
+		$link = $this->get_episode_download_link ( $episode_id, 'download' );
299
+		$duration = get_post_meta ( $episode_id, 'duration', true );
300
+		$size = get_post_meta ( $episode_id, 'filesize', true );
301 301
 		if ( ! $size ) {
302
-			$size_data = $this->get_file_size( $file );
303
-			$size = $size_data['formatted'];
302
+			$size_data = $this->get_file_size ( $file );
303
+			$size = $size_data[ 'formatted' ];
304 304
 			if ( $size ) {
305
-				if ( isset( $size_data['formatted'] ) ) {
306
-					update_post_meta( $episode_id, 'filesize', $size_data['formatted'] );
305
+				if ( isset( $size_data[ 'formatted' ] ) ) {
306
+					update_post_meta ( $episode_id, 'filesize', $size_data[ 'formatted' ] );
307 307
 				}
308 308
 
309
-				if ( isset( $size_data['raw'] ) ) {
310
-					update_post_meta( $episode_id, 'filesize_raw', $size_data['raw'] );
309
+				if ( isset( $size_data[ 'raw' ] ) ) {
310
+					update_post_meta ( $episode_id, 'filesize_raw', $size_data[ 'raw' ] );
311 311
 				}
312 312
 			}
313 313
 		}
314 314
 
315
-		$date_recorded = get_post_meta( $episode_id, 'date_recorded', true );
315
+		$date_recorded = get_post_meta ( $episode_id, 'date_recorded', true );
316 316
 
317 317
 		// Build up meta data array with default values
318 318
 		$meta = array(
@@ -323,62 +323,62 @@  discard block
 block discarded – undo
323 323
 			'date_recorded' => '',
324 324
 		);
325 325
 
326
-		if( $link ) {
327
-			$meta['link'] = $link;
326
+		if ( $link ) {
327
+			$meta[ 'link' ] = $link;
328 328
 		}
329 329
 
330
-		if( $link && apply_filters( 'ssp_show_new_window_link', true, $context ) ) {
331
-			$meta['new_window'] = true;
330
+		if ( $link && apply_filters ( 'ssp_show_new_window_link', true, $context ) ) {
331
+			$meta[ 'new_window' ] = true;
332 332
 		}
333 333
 
334
-		if( $link ) {
335
-			$meta['duration'] = $duration;
334
+		if ( $link ) {
335
+			$meta[ 'duration' ] = $duration;
336 336
 		}
337 337
 
338
-		if( $size ) {
339
-			$meta['size'] = $size;
338
+		if ( $size ) {
339
+			$meta[ 'size' ] = $size;
340 340
 		}
341 341
 
342
-		if( $date_recorded ) {
343
-			$meta['date_recorded'] = $date_recorded;
342
+		if ( $date_recorded ) {
343
+			$meta[ 'date_recorded' ] = $date_recorded;
344 344
 		}
345 345
 
346 346
 		// Allow dynamic filtering of meta data - to remove, add or reorder meta items
347
-		$meta = apply_filters( 'ssp_episode_meta_details', $meta, $episode_id, $context );
347
+		$meta = apply_filters ( 'ssp_episode_meta_details', $meta, $episode_id, $context );
348 348
 
349 349
 		$meta_display = '';
350
-		$meta_sep = apply_filters( 'ssp_episode_meta_separator', ' | ' );
350
+		$meta_sep = apply_filters ( 'ssp_episode_meta_separator', ' | ' );
351 351
 		foreach ( $meta as $key => $data ) {
352 352
 
353
-			if( ! $data ) {
353
+			if ( ! $data ) {
354 354
 				continue;
355 355
 			}
356 356
 
357
-			if( $meta_display ) {
357
+			if ( $meta_display ) {
358 358
 				$meta_display .= $meta_sep;
359 359
 			}
360 360
 
361
-			switch( $key ) {
361
+			switch ( $key ) {
362 362
 
363 363
 				case 'link':
364
-					$meta_display .= '<a href="' . esc_url( $data ) . '" title="' . get_the_title() . ' " class="podcast-meta-download" download>' . __( 'Download file' , 'seriously-simple-podcasting' ) . '</a>';
364
+					$meta_display .= '<a href="'.esc_url ( $data ).'" title="'.get_the_title ().' " class="podcast-meta-download" download>'.__ ( 'Download file', 'seriously-simple-podcasting' ).'</a>';
365 365
 				break;
366 366
 
367 367
 				case 'new_window':
368
-					$play_link = add_query_arg( 'ref', 'new_window', $link );
369
-					$meta_display .= '<a href="' . esc_url( $play_link ) . '" target="_blank" title="' . get_the_title() . ' " class="podcast-meta-new-window">' . __( 'Play in new window' , 'seriously-simple-podcasting' ) . '</a>';
368
+					$play_link = add_query_arg ( 'ref', 'new_window', $link );
369
+					$meta_display .= '<a href="'.esc_url ( $play_link ).'" target="_blank" title="'.get_the_title ().' " class="podcast-meta-new-window">'.__ ( 'Play in new window', 'seriously-simple-podcasting' ).'</a>';
370 370
 				break;
371 371
 
372 372
 				case 'duration':
373
-					$meta_display .= '<span class="podcast-meta-duration">' . __( 'Duration' , 'seriously-simple-podcasting' ) . ': ' . $data . '</span>';
373
+					$meta_display .= '<span class="podcast-meta-duration">'.__ ( 'Duration', 'seriously-simple-podcasting' ).': '.$data.'</span>';
374 374
 				break;
375 375
 
376 376
 				case 'size':
377
-					$meta_display .= '<span class="podcast-meta-size">' . __( 'Size' , 'seriously-simple-podcasting' ) . ': ' . $data . '</span>';
377
+					$meta_display .= '<span class="podcast-meta-size">'.__ ( 'Size', 'seriously-simple-podcasting' ).': '.$data.'</span>';
378 378
 				break;
379 379
 
380 380
 				case 'date_recorded':
381
-					$meta_display .= '<span class="podcast-meta-date">' . __( 'Recorded on' , 'seriously-simple-podcasting' ) . ' ' . date_i18n( get_option( 'date_format' ), strtotime( $data ) ) . '</span>';
381
+					$meta_display .= '<span class="podcast-meta-date">'.__ ( 'Recorded on', 'seriously-simple-podcasting' ).' '.date_i18n ( get_option ( 'date_format' ), strtotime ( $data ) ).'</span>';
382 382
 				break;
383 383
 
384 384
 				// Allow for custom items to be added, but only allow a small amount of HTML tags
@@ -394,13 +394,13 @@  discard block
 block discarded – undo
394 394
 							'target' => array(),
395 395
 						),
396 396
 					);
397
-					$meta_display .= wp_kses( $data, $allowed_tags );
397
+					$meta_display .= wp_kses ( $data, $allowed_tags );
398 398
 				break;
399 399
 
400 400
 			}
401 401
 		}
402 402
 
403
-		$meta_display = '<div class="podcast_meta"><aside>' . $meta_display . '</aside></div>';
403
+		$meta_display = '<div class="podcast_meta"><aside>'.$meta_display.'</aside></div>';
404 404
 
405 405
 		return $meta_display;
406 406
 
@@ -412,43 +412,43 @@  discard block
 block discarded – undo
412 412
 	 */
413 413
 	public function add_to_home_query( $query ) {
414 414
 
415
-		if ( is_admin() ) {
415
+		if ( is_admin () ) {
416 416
 			return;
417 417
 		}
418 418
 
419
-		$include_in_main_query = get_option('ss_podcasting_include_in_main_query');
419
+		$include_in_main_query = get_option ( 'ss_podcasting_include_in_main_query' );
420 420
 		if ( $include_in_main_query && $include_in_main_query == 'on' ) {
421
-			if ( $query->is_home() && $query->is_main_query() ) {
422
-				$query->set( 'post_type', array( 'post', 'podcast' ) );
421
+			if ( $query->is_home () && $query->is_main_query () ) {
422
+				$query->set ( 'post_type', array( 'post', 'podcast' ) );
423 423
 			}
424 424
 		}
425 425
 	}
426 426
 
427
-	public function add_all_post_types ( $query ) {
427
+	public function add_all_post_types( $query ) {
428 428
 
429
-		if ( is_admin() ) {
429
+		if ( is_admin () ) {
430 430
 			return;
431 431
 		}
432 432
 
433
-		if ( ! $query->is_main_query() ) {
433
+		if ( ! $query->is_main_query () ) {
434 434
 			return;
435 435
 		}
436 436
 
437
-		if ( is_post_type_archive( 'podcast' ) || is_tax( 'series' ) ) {
437
+		if ( is_post_type_archive ( 'podcast' ) || is_tax ( 'series' ) ) {
438 438
 
439
-			$podcast_post_types = ssp_post_types( false );
439
+			$podcast_post_types = ssp_post_types ( false );
440 440
 
441 441
 			if ( empty( $podcast_post_types ) ) {
442 442
 				return;
443 443
 			}
444 444
 
445
-			$episode_ids = ssp_episode_ids();
445
+			$episode_ids = ssp_episode_ids ();
446 446
 			if ( ! empty( $episode_ids ) ) {
447 447
 
448
-				$query->set( 'post__in', $episode_ids );
448
+				$query->set ( 'post__in', $episode_ids );
449 449
 
450
-				$podcast_post_types[] = 'podcast';
451
-				$query->set( 'post_type', $podcast_post_types );
450
+				$podcast_post_types[ ] = 'podcast';
451
+				$query->set ( 'post_type', $podcast_post_types );
452 452
 
453 453
 			}
454 454
 
@@ -466,29 +466,29 @@  discard block
 block discarded – undo
466 466
 		if ( $file ) {
467 467
 
468 468
 			// Include media functions if necessary
469
-			if ( ! function_exists( 'wp_read_audio_metadata' ) ) {
470
-				require_once( ABSPATH . 'wp-admin/includes/media.php' );
469
+			if ( ! function_exists ( 'wp_read_audio_metadata' ) ) {
470
+				require_once( ABSPATH.'wp-admin/includes/media.php' );
471 471
 			}
472 472
 
473 473
 			// translate file URL to local file path if possible
474
-			$file = $this->get_local_file_path( $file );
474
+			$file = $this->get_local_file_path ( $file );
475 475
 
476 476
 			// Get file data (for local file)
477
-			$data = wp_read_audio_metadata( $file );
477
+			$data = wp_read_audio_metadata ( $file );
478 478
 
479 479
 			$raw = $formatted = '';
480 480
 
481 481
 			if ( $data ) {
482
-				$raw = $data['filesize'];
483
-				$formatted = $this->format_bytes( $raw );
482
+				$raw = $data[ 'filesize' ];
483
+				$formatted = $this->format_bytes ( $raw );
484 484
 			} else {
485 485
 
486 486
 				// get file data (for remote file)
487
-				$data = wp_remote_head( $file, array( 'timeout' => 10, 'redirection' => 5 ) );
487
+				$data = wp_remote_head ( $file, array( 'timeout' => 10, 'redirection' => 5 ) );
488 488
 
489
-				if ( ! is_wp_error( $data ) && is_array( $data ) && isset( $data['headers']['content-length'] ) ) {
490
-					$raw = $data['headers']['content-length'];
491
-					$formatted = $this->format_bytes( $raw );
489
+				if ( ! is_wp_error ( $data ) && is_array ( $data ) && isset( $data[ 'headers' ][ 'content-length' ] ) ) {
490
+					$raw = $data[ 'headers' ][ 'content-length' ];
491
+					$formatted = $this->format_bytes ( $raw );
492 492
 				}
493 493
 			}
494 494
 
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 					'formatted' => $formatted
500 500
 				);
501 501
 
502
-				return apply_filters( 'ssp_file_size', $size, $file );
502
+				return apply_filters ( 'ssp_file_size', $size, $file );
503 503
 			}
504 504
 
505 505
 		}
@@ -517,30 +517,30 @@  discard block
 block discarded – undo
517 517
 		if ( $file ) {
518 518
 
519 519
 			// Include media functions if necessary
520
-			if ( ! function_exists( 'wp_read_audio_metadata' ) ) {
521
-				require_once( ABSPATH . 'wp-admin/includes/media.php' );
520
+			if ( ! function_exists ( 'wp_read_audio_metadata' ) ) {
521
+				require_once( ABSPATH.'wp-admin/includes/media.php' );
522 522
 			}
523 523
 
524 524
 			// translate file URL to local file path if possible
525
-			$file = $this->get_local_file_path( $file );
525
+			$file = $this->get_local_file_path ( $file );
526 526
 
527 527
 			// Get file data (will only work for local files)
528
-			$data = wp_read_audio_metadata( $file );
528
+			$data = wp_read_audio_metadata ( $file );
529 529
 
530 530
 			$duration = false;
531 531
 
532 532
 			if ( $data ) {
533
-				if ( isset( $data['length_formatted'] ) && strlen( $data['length_formatted'] ) > 0 ) {
534
-					$duration = $data['length_formatted'];
533
+				if ( isset( $data[ 'length_formatted' ] ) && strlen ( $data[ 'length_formatted' ] ) > 0 ) {
534
+					$duration = $data[ 'length_formatted' ];
535 535
 				} else {
536
-					if ( isset( $data['length'] ) && strlen( $data['length'] ) > 0 ) {
537
-						$duration = gmdate( 'H:i:s', $data['length'] );
536
+					if ( isset( $data[ 'length' ] ) && strlen ( $data[ 'length' ] ) > 0 ) {
537
+						$duration = gmdate ( 'H:i:s', $data[ 'length' ] );
538 538
 					}
539 539
 				}
540 540
 			}
541 541
 
542 542
 			if ( $data ) {
543
-				return apply_filters( 'ssp_file_duration', $duration, $file );
543
+				return apply_filters ( 'ssp_file_duration', $duration, $file );
544 544
 			}
545 545
 
546 546
 		}
@@ -554,15 +554,15 @@  discard block
 block discarded – undo
554 554
 	 * @param  integer $precision Level of precision for formatting
555 555
 	 * @return mixed              Formatted file size on success, false on failure
556 556
 	 */
557
-	protected function format_bytes( $size , $precision = 2 ) {
557
+	protected function format_bytes( $size, $precision = 2 ) {
558 558
 
559 559
 		if ( $size ) {
560 560
 
561
-		    $base = log ( $size ) / log( 1024 );
562
-		    $suffixes = array( '' , 'k' , 'M' , 'G' , 'T' );
563
-		    $formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ];
561
+		    $base = log ( $size ) / log ( 1024 );
562
+		    $suffixes = array( '', 'k', 'M', 'G', 'T' );
563
+		    $formatted_size = round ( pow ( 1024, $base - floor ( $base ) ), $precision ).$suffixes[ floor ( $base ) ];
564 564
 
565
-		    return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size );
565
+		    return apply_filters ( 'ssp_file_size_formatted', $formatted_size, $size );
566 566
 		}
567 567
 
568 568
 		return false;
@@ -578,10 +578,10 @@  discard block
 block discarded – undo
578 578
 
579 579
 		// Let's hash the URL to ensure that we don't get
580 580
 		// any illegal chars that might break the cache.
581
-		$key = md5( $url );
581
+		$key = md5 ( $url );
582 582
 
583 583
 		// Do we have anything in the cache for this URL?
584
-		$attachment_id = wp_cache_get( $key, 'attachment_id' );
584
+		$attachment_id = wp_cache_get ( $key, 'attachment_id' );
585 585
 
586 586
 		if ( $attachment_id === false ) {
587 587
 
@@ -598,39 +598,39 @@  discard block
 block discarded – undo
598 598
 
599 599
 
600 600
 			// Function introduced in 4.0, let's try this first.
601
-			if ( function_exists( 'attachment_url_to_postid' ) ) {
602
-				$attachment_id = absint( attachment_url_to_postid( $url ) );
601
+			if ( function_exists ( 'attachment_url_to_postid' ) ) {
602
+				$attachment_id = absint ( attachment_url_to_postid ( $url ) );
603 603
 				if ( 0 !== $attachment_id ) {
604
-					wp_cache_set( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
604
+					wp_cache_set ( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
605 605
 					return $attachment_id;
606 606
 				}
607 607
 			}
608 608
 
609 609
 			// Then this.
610
-			if ( preg_match( '#\.[a-zA-Z0-9]+$#', $url ) ) {
611
-				$sql = $wpdb->prepare(
610
+			if ( preg_match ( '#\.[a-zA-Z0-9]+$#', $url ) ) {
611
+				$sql = $wpdb->prepare (
612 612
 					"SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND guid = %s",
613
-					esc_url_raw( $url )
613
+					esc_url_raw ( $url )
614 614
 				);
615
-				$attachment_id = absint( $wpdb->get_var( $sql ) );
615
+				$attachment_id = absint ( $wpdb->get_var ( $sql ) );
616 616
 				if ( 0 !== $attachment_id ) {
617
-					wp_cache_set( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
617
+					wp_cache_set ( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
618 618
 					return $attachment_id;
619 619
 				}
620 620
 			}
621 621
 
622 622
 			// And then try this
623
-			$upload_dir_paths = wp_upload_dir();
624
-			if ( false !== strpos( $url, $upload_dir_paths['baseurl'] ) ) {
623
+			$upload_dir_paths = wp_upload_dir ();
624
+			if ( false !== strpos ( $url, $upload_dir_paths[ 'baseurl' ] ) ) {
625 625
 				// Ensure that we have file extension that matches iTunes.
626
-				$url = preg_replace( '/(?=\.(m4a|mp3|mov|mp4)$)/i', '', $url );
626
+				$url = preg_replace ( '/(?=\.(m4a|mp3|mov|mp4)$)/i', '', $url );
627 627
 				// Remove the upload path base directory from the attachment URL
628
-				$url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $url );
628
+				$url = str_replace ( $upload_dir_paths[ 'baseurl' ].'/', '', $url );
629 629
 				// Finally, run a custom database query to get the attachment ID from the modified attachment URL
630
-				$sql = $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $url );
631
-				$attachment_id = absint( $wpdb->get_var( $sql ) );
630
+				$sql = $wpdb->prepare ( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $url );
631
+				$attachment_id = absint ( $wpdb->get_var ( $sql ) );
632 632
 				if ( 0 !== $attachment_id ) {
633
-					wp_cache_set( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
633
+					wp_cache_set ( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
634 634
 					return $attachment_id;
635 635
 				}
636 636
 			}
@@ -648,20 +648,20 @@  discard block
 block discarded – undo
648 648
 	public function get_attachment_mimetype( $attachment = '' ) {
649 649
 
650 650
 		// Let's hash the URL to ensure that we don't get any illegal chars that might break the cache.
651
-		$key = md5( $attachment );
651
+		$key = md5 ( $attachment );
652 652
 
653 653
 		if ( $attachment ) {
654 654
 			// Do we have anything in the cache for this?
655
-			$mime = wp_cache_get( $key, 'mime-type' );
655
+			$mime = wp_cache_get ( $key, 'mime-type' );
656 656
 			if ( $mime === false ) {
657 657
 
658 658
 				// Get the ID
659
-				$id = $this->get_attachment_id_from_url( $attachment );
659
+				$id = $this->get_attachment_id_from_url ( $attachment );
660 660
 
661 661
 				// Get the MIME type
662
-				$mime = get_post_mime_type( $id );
662
+				$mime = get_post_mime_type ( $id );
663 663
 				// Set the cache
664
-				wp_cache_set( $key, $mime, 'mime-type', DAY_IN_SECONDS );
664
+				wp_cache_set ( $key, $mime, 'mime-type', DAY_IN_SECONDS );
665 665
 			}
666 666
 
667 667
 		    return $mime;
@@ -678,8 +678,8 @@  discard block
 block discarded – undo
678 678
 	 * @return string        	   Audio player HTML on success, false on failure
679 679
 	 */
680 680
 	public function audio_player( $src = '', $episode_id = 0 ) {
681
-		$player = $this->media_player( $src, $episode_id );
682
-		return apply_filters( 'ssp_audio_player', $player, $src, $episode_id );
681
+		$player = $this->media_player ( $src, $episode_id );
682
+		return apply_filters ( 'ssp_audio_player', $player, $src, $episode_id );
683 683
 	}
684 684
 
685 685
 	/**
@@ -688,40 +688,40 @@  discard block
 block discarded – undo
688 688
 	 * @param  integer $episode_id Episode ID for audio file
689 689
 	 * @return string              Media player HTML on success, empty string on failure
690 690
 	 */
691
-	public function media_player ( $src = '', $episode_id = 0 ) {
691
+	public function media_player( $src = '', $episode_id = 0 ) {
692 692
 		$player = '';
693 693
 
694 694
 		if ( $src ) {
695 695
 
696 696
 			// Get episode type and default to audio
697
-			$type = $this->get_episode_type( $episode_id );
698
-			if( ! $type ) {
697
+			$type = $this->get_episode_type ( $episode_id );
698
+			if ( ! $type ) {
699 699
 				$type = 'audio';
700 700
 			}
701 701
 
702 702
 			// Switch to podcast player URL
703
-			$src = str_replace( 'podcast-download', 'podcast-player', $src );
703
+			$src = str_replace ( 'podcast-download', 'podcast-player', $src );
704 704
 
705 705
 			// Set up paramters for media player
706 706
 			$params = array( 'src' => $src, 'preload' => 'none' );
707 707
 
708 708
 			// Use built-in WordPress media player
709
-			switch( $type ) {
710
-				case 'audio': $player = wp_audio_shortcode( $params ); break;
709
+			switch ( $type ) {
710
+				case 'audio': $player = wp_audio_shortcode ( $params ); break;
711 711
 				case 'video':
712 712
 					// Use featured image as video poster
713
-					if( $episode_id && has_post_thumbnail( $episode_id ) ) {
714
-						$poster = wp_get_attachment_url( get_post_thumbnail_id( $episode_id ) );
715
-						if( $poster ) {
716
-							$params['poster'] = $poster;
713
+					if ( $episode_id && has_post_thumbnail ( $episode_id ) ) {
714
+						$poster = wp_get_attachment_url ( get_post_thumbnail_id ( $episode_id ) );
715
+						if ( $poster ) {
716
+							$params[ 'poster' ] = $poster;
717 717
 						}
718 718
 					}
719
-					$player = wp_video_shortcode( $params );
719
+					$player = wp_video_shortcode ( $params );
720 720
 				break;
721 721
 			}
722 722
 
723 723
 			// Allow filtering so that alternative players can be used
724
-			$player = apply_filters( 'ssp_media_player', $player, $src, $episode_id );
724
+			$player = apply_filters ( 'ssp_media_player', $player, $src, $episode_id );
725 725
 		}
726 726
 
727 727
 		return $player;
@@ -736,17 +736,17 @@  discard block
 block discarded – undo
736 736
 	public function get_image( $id = 0, $size = 'full' ) {
737 737
 		$image = '';
738 738
 
739
-		if ( has_post_thumbnail( $id ) ) {
739
+		if ( has_post_thumbnail ( $id ) ) {
740 740
 			// If not a string or an array, and not an integer, default to 200x9999.
741
-			if ( is_int( $size ) || ( 0 < intval( $size ) ) ) {
742
-				$size = array( intval( $size ), intval( $size ) );
743
-			} elseif ( ! is_string( $size ) && ! is_array( $size ) ) {
741
+			if ( is_int ( $size ) || ( 0 < intval ( $size ) ) ) {
742
+				$size = array( intval ( $size ), intval ( $size ) );
743
+			} elseif ( ! is_string ( $size ) && ! is_array ( $size ) ) {
744 744
 				$size = array( 200, 9999 );
745 745
 			}
746
-			$image = get_the_post_thumbnail( intval( $id ), $size );
746
+			$image = get_the_post_thumbnail ( intval ( $id ), $size );
747 747
 		}
748 748
 
749
-		return apply_filters( 'ssp_episode_image', $image, $id );
749
+		return apply_filters ( 'ssp_episode_image', $image, $id );
750 750
 	}
751 751
 
752 752
 	/**
@@ -761,29 +761,29 @@  discard block
 block discarded – undo
761 761
 			'series' => ''
762 762
 		);
763 763
 
764
-		$args = apply_filters( 'ssp_get_podcast_args', wp_parse_args( $args, $defaults ) );
764
+		$args = apply_filters ( 'ssp_get_podcast_args', wp_parse_args ( $args, $defaults ) );
765 765
 
766 766
 		$query = array();
767 767
 
768
-		if ( 'episodes' == $args['content'] ) {
768
+		if ( 'episodes' == $args[ 'content' ] ) {
769 769
 
770 770
 			// Get selected series
771 771
 			$podcast_series = '';
772
-			if ( isset( $args['series'] ) && $args['series'] ) {
773
-				$podcast_series = $args['series'];
772
+			if ( isset( $args[ 'series' ] ) && $args[ 'series' ] ) {
773
+				$podcast_series = $args[ 'series' ];
774 774
 			}
775 775
 
776 776
 			// Get query args
777
-			$query_args = apply_filters( 'ssp_get_podcast_query_args', ssp_episodes( -1, $podcast_series, true, '' ) );
777
+			$query_args = apply_filters ( 'ssp_get_podcast_query_args', ssp_episodes ( -1, $podcast_series, true, '' ) );
778 778
 
779 779
 			// The Query
780
-			$query = get_posts( $query_args );
780
+			$query = get_posts ( $query_args );
781 781
 
782 782
 			// The Display
783
-			if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
783
+			if ( ! is_wp_error ( $query ) && is_array ( $query ) && count ( $query ) > 0 ) {
784 784
 				foreach ( $query as $k => $v ) {
785 785
 					// Get the URL
786
-					$query[$k]->url = get_permalink( $v->ID );
786
+					$query[ $k ]->url = get_permalink ( $v->ID );
787 787
 				}
788 788
 			} else {
789 789
 				$query = false;
@@ -791,27 +791,27 @@  discard block
 block discarded – undo
791 791
 
792 792
 		} else {
793 793
 
794
-			$terms = get_terms( 'series' );
794
+			$terms = get_terms ( 'series' );
795 795
 
796
-			if ( count( $terms ) > 0) {
796
+			if ( count ( $terms ) > 0 ) {
797 797
 
798 798
 				foreach ( $terms as $term ) {
799
-					$query[ $term->term_id ] = new stdClass();
799
+					$query[ $term->term_id ] = new stdClass ();
800 800
 					$query[ $term->term_id ]->title = $term->name;
801
-		    		$query[ $term->term_id ]->url = get_term_link( $term );
801
+		    		$query[ $term->term_id ]->url = get_term_link ( $term );
802 802
 
803
-		    		$query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) );
803
+		    		$query_args = apply_filters ( 'ssp_get_podcast_series_query_args', ssp_episodes ( -1, $term->slug, true, '' ) );
804 804
 
805
-		    		$posts = get_posts( $query_args );
805
+		    		$posts = get_posts ( $query_args );
806 806
 
807
-		    		$count = count( $posts );
807
+		    		$count = count ( $posts );
808 808
 		    		$query[ $term->term_id ]->count = $count;
809 809
 			    }
810 810
 			}
811 811
 
812 812
 		}
813 813
 
814
-		$query['content'] = $args['content'];
814
+		$query[ 'content' ] = $args[ 'content' ];
815 815
 
816 816
 		return $query;
817 817
 	}
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 	public function get_enclosure( $episode_id = 0 ) {
825 825
 
826 826
 		if ( $episode_id ) {
827
-			return apply_filters( 'ssp_episode_enclosure', get_post_meta( $episode_id, 'audio_file', true ), $episode_id );
827
+			return apply_filters ( 'ssp_episode_enclosure', get_post_meta ( $episode_id, 'audio_file', true ), $episode_id );
828 828
 		}
829 829
 
830 830
 		return '';
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 
843 843
 		if ( $file != '' ) {
844 844
 
845
-			$post_types = ssp_post_types( true );
845
+			$post_types = ssp_post_types ( true );
846 846
 
847 847
 			$args = array(
848 848
 				'post_type' => $post_types,
@@ -852,17 +852,17 @@  discard block
 block discarded – undo
852 852
 				'meta_value' => $file
853 853
 			);
854 854
 
855
-			$qry = new WP_Query( $args );
855
+			$qry = new WP_Query ( $args );
856 856
 
857
-			if ( $qry->have_posts() ) {
858
-				while ( $qry->have_posts() ) { $qry->the_post();
857
+			if ( $qry->have_posts () ) {
858
+				while ( $qry->have_posts () ) { $qry->the_post ();
859 859
 					$episode = $post;
860 860
 					break;
861 861
 				}
862 862
 			}
863 863
 		}
864 864
 
865
-		return apply_filters( 'ssp_episode_from_file', $episode, $file );
865
+		return apply_filters ( 'ssp_episode_from_file', $episode, $file );
866 866
 
867 867
 	}
868 868
 
@@ -872,33 +872,33 @@  discard block
 block discarded – undo
872 872
 	 */
873 873
 	public function download_file() {
874 874
 
875
-		if ( is_podcast_download() ) {
875
+		if ( is_podcast_download () ) {
876 876
 			global $wp_query;
877 877
 
878 878
 			// Get requested episode ID
879
-			$episode_id = intval( $wp_query->query_vars['podcast_episode'] );
879
+			$episode_id = intval ( $wp_query->query_vars[ 'podcast_episode' ] );
880 880
 
881 881
 			if ( isset( $episode_id ) && $episode_id ) {
882 882
 
883 883
 				// Get episode post object
884
-				$episode = get_post( $episode_id );
884
+				$episode = get_post ( $episode_id );
885 885
 
886 886
 				// Make sure we have a valid episode post object
887
-				if ( ! $episode || ! is_object( $episode ) || is_wp_error( $episode ) || ! isset( $episode->ID ) ) {
887
+				if ( ! $episode || ! is_object ( $episode ) || is_wp_error ( $episode ) || ! isset( $episode->ID ) ) {
888 888
 					return;
889 889
 				}
890 890
 
891 891
 				// Do we have newlines?
892 892
 				$parts = false;
893
-				if( is_string( $episode ) ) {
894
-					$parts = explode( "\n", $episode );
893
+				if ( is_string ( $episode ) ) {
894
+					$parts = explode ( "\n", $episode );
895 895
 				}
896 896
 
897
-				if ( $parts && is_array( $parts ) && count( $parts ) > 1 ) {
898
-					$file = $parts[0];
897
+				if ( $parts && is_array ( $parts ) && count ( $parts ) > 1 ) {
898
+					$file = $parts[ 0 ];
899 899
 				} else {
900 900
 					// Get audio file for download
901
-					$file = $this->get_enclosure( $episode_id );
901
+					$file = $this->get_enclosure ( $episode_id );
902 902
 				}
903 903
 
904 904
 				// Exit if no file is found
@@ -908,77 +908,77 @@  discard block
 block discarded – undo
908 908
 
909 909
 				// Get file referrer
910 910
 				$referrer = '';
911
-				if( isset( $wp_query->query_vars['podcast_ref'] ) && $wp_query->query_vars['podcast_ref'] ) {
912
-					$referrer = $wp_query->query_vars['podcast_ref'];
911
+				if ( isset( $wp_query->query_vars[ 'podcast_ref' ] ) && $wp_query->query_vars[ 'podcast_ref' ] ) {
912
+					$referrer = $wp_query->query_vars[ 'podcast_ref' ];
913 913
 				} else {
914
-					if( isset( $_GET['ref'] ) ) {
915
-						$referrer = esc_attr( $_GET['ref'] );
914
+					if ( isset( $_GET[ 'ref' ] ) ) {
915
+						$referrer = esc_attr ( $_GET[ 'ref' ] );
916 916
 					}
917 917
 				}
918 918
 
919 919
 				// Allow other actions - functions hooked on here must not output any data
920
-			    do_action( 'ssp_file_download', $file, $episode, $referrer );
920
+			    do_action ( 'ssp_file_download', $file, $episode, $referrer );
921 921
 
922 922
 			    // Set necessary headers
923
-				header( "Pragma: no-cache" );
924
-				header( "Expires: 0" );
925
-				header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
926
-				header( "Robots: none" );
923
+				header ( "Pragma: no-cache" );
924
+				header ( "Expires: 0" );
925
+				header ( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
926
+				header ( "Robots: none" );
927 927
 
928 928
 		        // Check file referrer
929
-		        if( 'download' == $referrer ) {
929
+		        if ( 'download' == $referrer ) {
930 930
 
931 931
 		        	// Set size of file
932 932
 					// Do we have anything in Cache/DB?
933
-					$size = wp_cache_get( $episode_id, 'filesize_raw' );
933
+					$size = wp_cache_get ( $episode_id, 'filesize_raw' );
934 934
 
935 935
 					// Nothing in the cache, let's see if we can figure it out.
936 936
 					if ( false === $size ) {
937 937
 
938 938
 						// Do we have anything in post_meta?
939
-						$size = get_post_meta( $episode_id, 'filesize_raw', true );
939
+						$size = get_post_meta ( $episode_id, 'filesize_raw', true );
940 940
 
941 941
 						if ( empty( $size ) ) {
942 942
 
943 943
 							// Let's see if we can figure out the path...
944
-							$attachment_id = $this->get_attachment_id_from_url( $file );
944
+							$attachment_id = $this->get_attachment_id_from_url ( $file );
945 945
 
946
-							if ( ! empty( $attachment_id )  ) {
947
-								$size = filesize( get_attached_file( $attachment_id ) );
948
-								update_post_meta( $episode_id, 'filesize_raw', $size );
946
+							if ( ! empty( $attachment_id ) ) {
947
+								$size = filesize ( get_attached_file ( $attachment_id ) );
948
+								update_post_meta ( $episode_id, 'filesize_raw', $size );
949 949
 							}
950 950
 
951 951
 						}
952 952
 
953 953
 						// Update the cache
954
-						wp_cache_set( $episode_id, $size, 'filesize_raw' );
954
+						wp_cache_set ( $episode_id, $size, 'filesize_raw' );
955 955
 					}
956 956
 
957 957
 					// Send Content-Length header
958 958
 		        	if ( ! empty( $size ) ) {
959
-						header( "Content-Length: " . $size );
959
+						header ( "Content-Length: ".$size );
960 960
 					}
961 961
 
962 962
 		        	// Force file download
963
-		        	header( "Content-Type: application/force-download" );
963
+		        	header ( "Content-Type: application/force-download" );
964 964
 
965 965
 			        // Set other relevant headers
966
-			        header( "Content-Description: File Transfer" );
967
-			        header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" );
968
-			        header( "Content-Transfer-Encoding: binary" );
966
+			        header ( "Content-Description: File Transfer" );
967
+			        header ( "Content-Disposition: attachment; filename=\"".basename ( $file )."\";" );
968
+			        header ( "Content-Transfer-Encoding: binary" );
969 969
 
970 970
 			        // Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
971
-					$file = str_replace( ' ', '%20', $file );
971
+					$file = str_replace ( ' ', '%20', $file );
972 972
 
973 973
 			        // Use ssp_readfile_chunked() if allowed on the server or simply access file directly
974
-					@ssp_readfile_chunked( $file ) or header( 'Location: ' . $file );
974
+					@ssp_readfile_chunked ( $file ) or header ( 'Location: '.$file );
975 975
 				} else {
976 976
 
977 977
 					// Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
978
-					$file = str_replace( ' ', '%20', $file );
978
+					$file = str_replace ( ' ', '%20', $file );
979 979
 
980 980
 					// For all other referrers redirect to the raw file
981
-					wp_redirect( $file, 302 );
981
+					wp_redirect ( $file, 302 );
982 982
 				}
983 983
 
984 984
 				// Exit to prevent other processes running later on
@@ -995,16 +995,16 @@  discard block
 block discarded – undo
995 995
 	public function generator_tag( $gen, $type ) {
996 996
 
997 997
 		// Allow generator tags to be hidden if necessary
998
-		if ( apply_filters( 'ssp_show_generator_tag', true, $type ) ) {
998
+		if ( apply_filters ( 'ssp_show_generator_tag', true, $type ) ) {
999 999
 
1000
-			$generator = 'Seriously Simple Podcasting ' . esc_attr( $this->version );
1000
+			$generator = 'Seriously Simple Podcasting '.esc_attr ( $this->version );
1001 1001
 
1002 1002
 			switch ( $type ) {
1003 1003
 				case 'html':
1004
-					$gen .= "\n" . '<meta name="generator" content="' . $generator . '">';
1004
+					$gen .= "\n".'<meta name="generator" content="'.$generator.'">';
1005 1005
 				break;
1006 1006
 				case 'xhtml':
1007
-					$gen .= "\n" . '<meta name="generator" content="' . $generator . '" />';
1007
+					$gen .= "\n".'<meta name="generator" content="'.$generator.'" />';
1008 1008
 				break;
1009 1009
 			}
1010 1010
 
@@ -1020,53 +1020,53 @@  discard block
 block discarded – undo
1020 1020
 	public function rss_meta_tag() {
1021 1021
 
1022 1022
 		// Get feed slug
1023
-		$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
1023
+		$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
1024 1024
 
1025
-		if ( get_option( 'permalink_structure' ) ) {
1026
-			$feed_url = $this->home_url . 'feed/' . $feed_slug;
1025
+		if ( get_option ( 'permalink_structure' ) ) {
1026
+			$feed_url = $this->home_url.'feed/'.$feed_slug;
1027 1027
 		} else {
1028
-			$feed_url = $this->home_url . '?feed=' . $feed_slug;
1028
+			$feed_url = $this->home_url.'?feed='.$feed_slug;
1029 1029
 		}
1030 1030
 
1031
-		$custom_feed_url = get_option( 'ss_podcasting_feed_url' );
1031
+		$custom_feed_url = get_option ( 'ss_podcasting_feed_url' );
1032 1032
 		if ( $custom_feed_url ) {
1033 1033
 			$feed_url = $custom_feed_url;
1034 1034
 		}
1035 1035
 
1036
-		$feed_url = apply_filters( 'ssp_feed_url', $feed_url );
1036
+		$feed_url = apply_filters ( 'ssp_feed_url', $feed_url );
1037 1037
 
1038 1038
 		$html = '';
1039 1039
 
1040
-		if( apply_filters( 'ssp_show_global_feed_tag', true ) ) {
1041
-			$html = '<link rel="alternate" type="application/rss+xml" title="' . __( 'Podcast RSS feed', 'seriously-simple-podcasting' ) . '" href="' . esc_url( $feed_url ) . '" />';
1040
+		if ( apply_filters ( 'ssp_show_global_feed_tag', true ) ) {
1041
+			$html = '<link rel="alternate" type="application/rss+xml" title="'.__ ( 'Podcast RSS feed', 'seriously-simple-podcasting' ).'" href="'.esc_url ( $feed_url ).'" />';
1042 1042
 		}
1043 1043
 
1044 1044
 		// Check if this is a series taxonomy archive and display series-specific RSS feed tag
1045
-		$current_obj = get_queried_object();
1046
-		if( isset( $current_obj->taxonomy ) && 'series' == $current_obj->taxonomy && isset( $current_obj->slug ) && $current_obj->slug ) {
1045
+		$current_obj = get_queried_object ();
1046
+		if ( isset( $current_obj->taxonomy ) && 'series' == $current_obj->taxonomy && isset( $current_obj->slug ) && $current_obj->slug ) {
1047 1047
 
1048
-			if( apply_filters( 'ssp_show_series_feed_tag', true, $current_obj->slug ) ) {
1048
+			if ( apply_filters ( 'ssp_show_series_feed_tag', true, $current_obj->slug ) ) {
1049 1049
 
1050
-				if ( get_option( 'permalink_structure' ) ) {
1051
-					$series_feed_url = $feed_url . '/' . $current_obj->slug;
1050
+				if ( get_option ( 'permalink_structure' ) ) {
1051
+					$series_feed_url = $feed_url.'/'.$current_obj->slug;
1052 1052
 				} else {
1053
-					$series_feed_url = $feed_url . '&podcast_series=' . $current_obj->slug;
1053
+					$series_feed_url = $feed_url.'&podcast_series='.$current_obj->slug;
1054 1054
 				}
1055 1055
 
1056
-				$html .= "\n" . '<link rel="alternate" type="application/rss+xml" title="' . sprintf( __( '%s RSS feed', 'seriously-simple-podcasting' ), $current_obj->name ) . '" href="' . esc_url( $series_feed_url ) . '" />';
1056
+				$html .= "\n".'<link rel="alternate" type="application/rss+xml" title="'.sprintf ( __ ( '%s RSS feed', 'seriously-simple-podcasting' ), $current_obj->name ).'" href="'.esc_url ( $series_feed_url ).'" />';
1057 1057
 
1058 1058
 			}
1059 1059
 
1060 1060
 		}
1061 1061
 
1062
-		echo "\n" . apply_filters( 'ssp_rss_meta_tag', $html ) . "\n\n";
1062
+		echo "\n".apply_filters ( 'ssp_rss_meta_tag', $html )."\n\n";
1063 1063
 	}
1064 1064
 
1065 1065
 	/**
1066 1066
 	 * Register plugin widgets
1067 1067
 	 * @return void
1068 1068
 	 */
1069
-	public function register_widgets () {
1069
+	public function register_widgets() {
1070 1070
 
1071 1071
 		$widgets = array(
1072 1072
 			'recent-episodes' => 'Recent_Episodes',
@@ -1075,8 +1075,8 @@  discard block
 block discarded – undo
1075 1075
 		);
1076 1076
 
1077 1077
 		foreach ( $widgets as $id => $name ) {
1078
-			require_once( $this->dir . '/includes/widgets/class-ssp-widget-' . $id . '.php' );
1079
-			register_widget( 'SSP_Widget_' . $name );
1078
+			require_once( $this->dir.'/includes/widgets/class-ssp-widget-'.$id.'.php' );
1079
+			register_widget ( 'SSP_Widget_'.$name );
1080 1080
 		}
1081 1081
 
1082 1082
 	}
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
 	 * Register plugin shortcodes
1086 1086
 	 * @return void
1087 1087
 	 */
1088
-	public function register_shortcodes () {
1088
+	public function register_shortcodes() {
1089 1089
 
1090 1090
 		$shortcodes = array(
1091 1091
 			'podcast_episode',
@@ -1094,8 +1094,8 @@  discard block
 block discarded – undo
1094 1094
 		);
1095 1095
 
1096 1096
 		foreach ( $shortcodes as $shortcode ) {
1097
-			require_once( $this->dir . '/includes/shortcodes/class-ssp-shortcode-' . $shortcode . '.php' );
1098
-			add_shortcode( $shortcode, array( $GLOBALS['ssp_shortcodes'][ $shortcode ], 'shortcode' ) );
1097
+			require_once( $this->dir.'/includes/shortcodes/class-ssp-shortcode-'.$shortcode.'.php' );
1098
+			add_shortcode ( $shortcode, array( $GLOBALS[ 'ssp_shortcodes' ][ $shortcode ], 'shortcode' ) );
1099 1099
 		}
1100 1100
 
1101 1101
 	}
@@ -1106,64 +1106,64 @@  discard block
 block discarded – undo
1106 1106
 	 * @param  array   $content_items Orderd array of content items to display
1107 1107
 	 * @return string                 HTML of episode with specified content items
1108 1108
 	 */
1109
-	public function podcast_episode ( $episode_id = 0, $content_items = array( 'title', 'player', 'details' ), $context = '' ) {
1109
+	public function podcast_episode( $episode_id = 0, $content_items = array( 'title', 'player', 'details' ), $context = '' ) {
1110 1110
 		global $post, $episode_context;
1111 1111
 
1112
-		if ( ! $episode_id || ! is_array( $content_items ) || empty( $content_items ) ) {
1112
+		if ( ! $episode_id || ! is_array ( $content_items ) || empty( $content_items ) ) {
1113 1113
 			return;
1114 1114
 		}
1115 1115
 
1116 1116
 		// Get episode object
1117
-		$episode = get_post( $episode_id );
1117
+		$episode = get_post ( $episode_id );
1118 1118
 
1119
-		if ( ! $episode || is_wp_error( $episode ) ) {
1119
+		if ( ! $episode || is_wp_error ( $episode ) ) {
1120 1120
 			return;
1121 1121
 		}
1122 1122
 
1123
-		$html = '<div class="podcast-episode episode-' . esc_attr( $episode_id ) . '">' . "\n";
1123
+		$html = '<div class="podcast-episode episode-'.esc_attr ( $episode_id ).'">'."\n";
1124 1124
 
1125 1125
 			// Setup post data for episode post object
1126 1126
 			$post = $episode;
1127
-			setup_postdata( $post );
1127
+			setup_postdata ( $post );
1128 1128
 
1129 1129
 			$episode_context = $context;
1130 1130
 
1131 1131
 			// Display specified content items in the order supplied
1132 1132
 			foreach ( $content_items as $item ) {
1133 1133
 
1134
-				switch( $item ) {
1134
+				switch ( $item ) {
1135 1135
 
1136 1136
 					case 'title':
1137
-						$html .= '<h3 class="episode-title">' . get_the_title() . '</h3>' . "\n";
1137
+						$html .= '<h3 class="episode-title">'.get_the_title ().'</h3>'."\n";
1138 1138
 					break;
1139 1139
 
1140 1140
 					case 'excerpt':
1141
-						$html .= '<p class="episode-excerpt">' . get_the_excerpt() . '</p>' . "\n";
1141
+						$html .= '<p class="episode-excerpt">'.get_the_excerpt ().'</p>'."\n";
1142 1142
 					break;
1143 1143
 
1144 1144
 					case 'content':
1145
-						$html .= '<div class="episode-content">' . apply_filters( 'the_content', get_the_content() ) . '</div>' . "\n";
1145
+						$html .= '<div class="episode-content">'.apply_filters ( 'the_content', get_the_content () ).'</div>'."\n";
1146 1146
 					break;
1147 1147
 
1148 1148
 					case 'player':
1149
-						$file = $this->get_enclosure( $episode_id );
1150
-						if ( get_option( 'permalink_structure' ) ) {
1151
-							$file = $this->get_episode_download_link( $episode_id );
1149
+						$file = $this->get_enclosure ( $episode_id );
1150
+						if ( get_option ( 'permalink_structure' ) ) {
1151
+							$file = $this->get_episode_download_link ( $episode_id );
1152 1152
 						}
1153
-		    			$html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n";
1153
+		    			$html .= '<div class="podcast_player">'.$this->media_player ( $file, $episode_id ).'</div>'."\n";
1154 1154
 					break;
1155 1155
 
1156 1156
 					case 'details':
1157
-						$html .= $this->episode_meta_details( $episode_id, $episode_context );
1157
+						$html .= $this->episode_meta_details ( $episode_id, $episode_context );
1158 1158
 					break;
1159 1159
 
1160 1160
 				}
1161 1161
 			}
1162 1162
 
1163 1163
 			// Reset post data after fetching episode details
1164
-			wp_reset_postdata();
1164
+			wp_reset_postdata ();
1165 1165
 
1166
-		$html .= '</div>' . "\n";
1166
+		$html .= '</div>'."\n";
1167 1167
 
1168 1168
 	    return $html;
1169 1169
 	}
@@ -1178,26 +1178,26 @@  discard block
 block discarded – undo
1178 1178
 	function get_local_file_path( $file ) {
1179 1179
 
1180 1180
 		// Identify file by root path and not URL (required for getID3 class)
1181
-		$site_root = trailingslashit( ABSPATH );
1181
+		$site_root = trailingslashit ( ABSPATH );
1182 1182
 
1183 1183
 		// Remove common dirs from the ends of site_url and site_root, so that file can be outside of the WordPress installation
1184
-		$root_chunks = explode( '/', $site_root );
1185
-		$url_chunks  = explode( '/', $this->site_url );
1184
+		$root_chunks = explode ( '/', $site_root );
1185
+		$url_chunks  = explode ( '/', $this->site_url );
1186 1186
 
1187
-		end( $root_chunks );
1188
-		end( $url_chunks );
1187
+		end ( $root_chunks );
1188
+		end ( $url_chunks );
1189 1189
 
1190
-		while ( ! is_null( key( $root_chunks ) ) && ! is_null( key( $url_chunks ) ) && ( current( $root_chunks ) == current( $url_chunks ) ) ) {
1191
-			array_pop( $root_chunks );
1192
-			array_pop( $url_chunks );
1193
-			end( $root_chunks );
1194
-			end( $url_chunks );
1190
+		while ( ! is_null ( key ( $root_chunks ) ) && ! is_null ( key ( $url_chunks ) ) && ( current ( $root_chunks ) == current ( $url_chunks ) ) ) {
1191
+			array_pop ( $root_chunks );
1192
+			array_pop ( $url_chunks );
1193
+			end ( $root_chunks );
1194
+			end ( $url_chunks );
1195 1195
 		}
1196 1196
 
1197
-		$site_root = implode('/', $root_chunks);
1198
-		$site_url  = implode('/', $url_chunks);
1197
+		$site_root = implode ( '/', $root_chunks );
1198
+		$site_url  = implode ( '/', $url_chunks );
1199 1199
 
1200
-		$file = str_replace( $site_url, $site_root, $file );
1200
+		$file = str_replace ( $site_url, $site_root, $file );
1201 1201
 
1202 1202
 		return $file;
1203 1203
 	}
@@ -1209,16 +1209,16 @@  discard block
 block discarded – undo
1209 1209
 	 * @param  string $type         Type of feed
1210 1210
 	 * @return string               Updated content type
1211 1211
 	 */
1212
-	public function feed_content_type ( $content_type = '', $type = '' ) {
1212
+	public function feed_content_type( $content_type = '', $type = '' ) {
1213 1213
 
1214
-		if( 'podcast' == $type ) {
1214
+		if ( 'podcast' == $type ) {
1215 1215
 			$content_type = 'text/xml';
1216 1216
 		}
1217 1217
 
1218 1218
 		return $content_type;
1219 1219
 	}
1220 1220
 
1221
-	public function load_localisation () {
1222
-		load_plugin_textdomain( 'seriously-simple-podcasting', false, basename( dirname( $this->file ) ) . '/languages/' );
1221
+	public function load_localisation() {
1222
+		load_plugin_textdomain ( 'seriously-simple-podcasting', false, basename ( dirname ( $this->file ) ).'/languages/' );
1223 1223
 	}
1224 1224
 }
Please login to merge, or discard this patch.
seriously-simple-podcasting.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly.
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined ( 'ABSPATH' ) ) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 require_once( 'includes/class-ssp-frontend.php' );
23 23
 
24 24
 global $ssp_admin, $ss_podcasting;
25
-$ssp_admin = new SSP_Admin( __FILE__, '1.14.10' );
26
-$ss_podcasting = new SSP_Frontend( __FILE__, '1.14.10' );
25
+$ssp_admin = new SSP_Admin ( __FILE__, '1.14.10' );
26
+$ss_podcasting = new SSP_Frontend ( __FILE__, '1.14.10' );
27 27
 
28
-if ( is_admin() ) {
28
+if ( is_admin () ) {
29 29
 	global $ssp_settings;
30 30
 	require_once( 'includes/class-ssp-settings.php' );
31
-	$ssp_settings = new SSP_Settings( __FILE__ );
31
+	$ssp_settings = new SSP_Settings ( __FILE__ );
32 32
 }
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
templates/feed-podcast.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 	// Request password and give access if correct
31 31
 	if ( ! isset( $_SERVER['PHP_AUTH_USER'] ) && ! isset( $_SERVER['PHP_AUTH_PW'] ) ) {
32
-	    $give_access = false;
32
+		$give_access = false;
33 33
 	} else {
34 34
 		$username = get_option( 'ss_podcasting_protection_username' );
35 35
 		$password = get_option( 'ss_podcasting_protection_password' );
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 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 80
 	header('WWW-Authenticate: Basic realm="Podcast Feed"');
81
-    header('HTTP/1.0 401 Unauthorized');
81
+	header('HTTP/1.0 401 Unauthorized');
82 82
 
83 83
 	die( $no_access_message );
84 84
 }
Please login to merge, or discard this 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.