Completed
Push — master ( 60090c...ef8f94 )
by Hugh
09:38 queued 06:51
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/plugin/seriously-simple-podcasting/reviews/?rate=5#new-post" 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/plugin/seriously-simple-podcasting/reviews/?rate=5#new-post" 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   +355 added lines, -355 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly.
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined ( 'ABSPATH' ) ) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -31,37 +31,37 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public function __construct( $file ) {
33 33
 		$this->file = $file;
34
-		$this->dir = dirname( $this->file );
35
-		$this->assets_dir = trailingslashit( $this->dir ) . 'assets';
36
-		$this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $this->file ) ) );
37
-		$this->home_url = trailingslashit( home_url() );
34
+		$this->dir = dirname ( $this->file );
35
+		$this->assets_dir = trailingslashit ( $this->dir ).'assets';
36
+		$this->assets_url = esc_url ( trailingslashit ( plugins_url ( '/assets/', $this->file ) ) );
37
+		$this->home_url = trailingslashit ( home_url () );
38 38
 		$this->token = 'podcast';
39 39
 		$this->settings_base = 'ss_podcasting_';
40 40
 
41
-		add_action( 'init', array( $this, 'load_settings' ), 11 );
41
+		add_action ( 'init', array( $this, 'load_settings' ), 11 );
42 42
 
43 43
 		// Register podcast settings
44
-		add_action( 'admin_init' , array( $this, 'register_settings' ) );
44
+		add_action ( 'admin_init', array( $this, 'register_settings' ) );
45 45
 
46 46
 		// Add settings page to menu
47
-		add_action( 'admin_menu', array( $this , 'add_menu_item' ) );
47
+		add_action ( 'admin_menu', array( $this, 'add_menu_item' ) );
48 48
 
49 49
 		// Add settings link to plugins page
50
-		add_filter( 'plugin_action_links_' . plugin_basename( $this->file ), array( $this , 'add_plugin_links' ) );
50
+		add_filter ( 'plugin_action_links_'.plugin_basename ( $this->file ), array( $this, 'add_plugin_links' ) );
51 51
 
52 52
 		// Load scripts for settings page
53
-		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) , 10 );
53
+		add_action ( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10 );
54 54
 
55 55
 		// Mark date on which feed redirection was activated
56
-		add_action( 'update_option', array( $this, 'mark_feed_redirect_date' ) , 10 , 3 );
56
+		add_action ( 'update_option', array( $this, 'mark_feed_redirect_date' ), 10, 3 );
57 57
 
58 58
 		// New caps for editors and above.
59
-		add_action( 'admin_init', array( $this, 'add_caps' ), 1 );
59
+		add_action ( 'admin_init', array( $this, 'add_caps' ), 1 );
60 60
 
61 61
 	}
62 62
 
63 63
 	public function load_settings() {
64
-		$this->settings = $this->settings_fields();
64
+		$this->settings = $this->settings_fields ();
65 65
 	}
66 66
 
67 67
 	/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @return  void
70 70
 	 */
71 71
 	public function add_menu_item() {
72
-		add_submenu_page( 'edit.php?post_type=podcast' , __( 'Podcast Settings', 'seriously-simple-podcasting' ) , __( 'Settings', 'seriously-simple-podcasting' ), 'manage_podcast' , 'podcast_settings' , array( $this , 'settings_page' ) );
72
+		add_submenu_page ( 'edit.php?post_type=podcast', __ ( 'Podcast Settings', 'seriously-simple-podcasting' ), __ ( 'Settings', 'seriously-simple-podcasting' ), 'manage_podcast', 'podcast_settings', array( $this, 'settings_page' ) );
73 73
 	}
74 74
 
75 75
 	/**
@@ -79,19 +79,19 @@  discard block
 block discarded – undo
79 79
 
80 80
 		// Roles you'd like to have administer the podcast settings page.
81 81
 		// Admin and Editor, as default.
82
-		$roles = apply_filters( 'ssp_manage_podcast', array( 'administrator', 'editor' ) );
82
+		$roles = apply_filters ( 'ssp_manage_podcast', array( 'administrator', 'editor' ) );
83 83
 
84 84
 		// Loop through each role and assign capabilities
85
-		foreach( $roles as $the_role ) {
85
+		foreach ( $roles as $the_role ) {
86 86
 
87
-			$role = get_role( $the_role );
87
+			$role = get_role ( $the_role );
88 88
 			$caps = array(
89 89
 				'manage_podcast',
90 90
 			);
91 91
 
92 92
 			// Add the caps.
93 93
 			foreach ( $caps as $cap ) {
94
-				$this->maybe_add_cap( $role, $cap );
94
+				$this->maybe_add_cap ( $role, $cap );
95 95
 			}
96 96
 		}
97 97
 	}
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	public function maybe_add_cap( $role, $cap ) {
107 107
 		// Update the roles, if needed.
108
-		if ( ! $role->has_cap( $cap ) ) {
109
-			$role->add_cap( $cap );
108
+		if ( ! $role->has_cap ( $cap ) ) {
109
+			$role->add_cap ( $cap );
110 110
 		}
111 111
 	}
112 112
 
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
 	 * @return array $links Modified links
117 117
 	 */
118 118
 	public function add_plugin_links( $links ) {
119
-		$settings_link = '<a href="edit.php?post_type=podcast&page=podcast_settings">' . __( 'Settings', 'seriously-simple-podcasting' ) . '</a>';
120
-  		array_push( $links, $settings_link );
119
+		$settings_link = '<a href="edit.php?post_type=podcast&page=podcast_settings">'.__ ( 'Settings', 'seriously-simple-podcasting' ).'</a>';
120
+  		array_push ( $links, $settings_link );
121 121
   		return $links;
122 122
 	}
123 123
 
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function enqueue_scripts() {
129 129
 		global $pagenow;
130
-		if ( in_array( $pagenow, array( 'post-new.php', 'post.php' ) ) || ( isset( $_GET['page'] ) && 'podcast_settings' == $_GET['page'] ) ) {
131
-			wp_enqueue_media();
130
+		if ( in_array ( $pagenow, array( 'post-new.php', 'post.php' ) ) || ( isset( $_GET[ 'page' ] ) && 'podcast_settings' == $_GET[ 'page' ] ) ) {
131
+			wp_enqueue_media ();
132 132
 		}
133 133
 	}
134 134
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 		// Set options for post type selection
145 145
 		foreach ( $wp_post_types as $post_type => $data ) {
146 146
 
147
-			if ( in_array( $post_type, array( 'page', 'attachment', 'revision', 'nav_menu_item', 'wooframework', 'podcast' ) ) ){
147
+			if ( in_array ( $post_type, array( 'page', 'attachment', 'revision', 'nav_menu_item', 'wooframework', 'podcast' ) ) ) {
148 148
 				continue;
149 149
 			}
150 150
 
@@ -153,181 +153,181 @@  discard block
 block discarded – undo
153 153
 
154 154
 		// Set up available category options
155 155
 		$category_options = array(
156
-			'' => __( '-- None --', 'seriously-simple-podcasting' ),
157
-			'Arts' => __( 'Arts', 'seriously-simple-podcasting' ),
158
-			'Business' => __( 'Business', 'seriously-simple-podcasting' ),
159
-			'Comedy' => __( 'Comedy', 'seriously-simple-podcasting' ),
160
-			'Education' => __( 'Education', 'seriously-simple-podcasting' ),
161
-			'Games & Hobbies' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ),
162
-			'Government & Organizations' => __( 'Government & Organizations', 'seriously-simple-podcasting' ),
163
-			'Health' => __( 'Health', 'seriously-simple-podcasting' ),
164
-			'Kids & Family' => __( 'Kids & Family', 'seriously-simple-podcasting' ),
165
-			'Music' => __( 'Music', 'seriously-simple-podcasting' ),
166
-			'News & Politics' => __( 'News & Politics', 'seriously-simple-podcasting' ),
167
-			'Religion & Spirituality' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ),
168
-			'Science & Medicine' => __( 'Science & Medicine', 'seriously-simple-podcasting' ),
169
-			'Society & Culture' => __( 'Society & Culture', 'seriously-simple-podcasting' ),
170
-			'Sports & Recreation' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ),
171
-			'Technology' => __( 'Technology', 'seriously-simple-podcasting' ),
172
-			'TV & Film' => __( 'TV & Film', 'seriously-simple-podcasting' ),
156
+			'' => __ ( '-- None --', 'seriously-simple-podcasting' ),
157
+			'Arts' => __ ( 'Arts', 'seriously-simple-podcasting' ),
158
+			'Business' => __ ( 'Business', 'seriously-simple-podcasting' ),
159
+			'Comedy' => __ ( 'Comedy', 'seriously-simple-podcasting' ),
160
+			'Education' => __ ( 'Education', 'seriously-simple-podcasting' ),
161
+			'Games & Hobbies' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ),
162
+			'Government & Organizations' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ),
163
+			'Health' => __ ( 'Health', 'seriously-simple-podcasting' ),
164
+			'Kids & Family' => __ ( 'Kids & Family', 'seriously-simple-podcasting' ),
165
+			'Music' => __ ( 'Music', 'seriously-simple-podcasting' ),
166
+			'News & Politics' => __ ( 'News & Politics', 'seriously-simple-podcasting' ),
167
+			'Religion & Spirituality' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ),
168
+			'Science & Medicine' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ),
169
+			'Society & Culture' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ),
170
+			'Sports & Recreation' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ),
171
+			'Technology' => __ ( 'Technology', 'seriously-simple-podcasting' ),
172
+			'TV & Film' => __ ( 'TV & Film', 'seriously-simple-podcasting' ),
173 173
 		);
174 174
 
175 175
 		// Set up available sub-category options
176 176
 		$subcategory_options = array(
177 177
 
178
-			'' => __( '-- None --', 'seriously-simple-podcasting' ),
179
-
180
-			'Design' => array( 'label' => __( 'Design', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
181
-			'Fashion & Beauty' => array( 'label' => __( 'Fashion & Beauty', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
182
-			'Food' => array( 'label' => __( 'Food', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
183
-			'Literature' => array( 'label' => __( 'Literature', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
184
-			'Performing Arts' => array( 'label' => __( 'Performing Arts', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
185
-			'Visual Arts' => array( 'label' => __( 'Visual Arts', 'seriously-simple-podcasting' ), 'group' => __( 'Arts', 'seriously-simple-podcasting' ) ),
186
-
187
-			'Business News' => array( 'label' => __( 'Business News', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
188
-			'Careers' => array( 'label' => __( 'Careers', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
189
-			'Investing' => array( 'label' => __( 'Investing', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
190
-			'Management & Marketing' => array( 'label' => __( 'Management & Marketing', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
191
-			'Shopping' => array( 'label' => __( 'Shopping', 'seriously-simple-podcasting' ), 'group' => __( 'Business', 'seriously-simple-podcasting' ) ),
192
-
193
-			'Education' => array( 'label' => __( 'Education', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
194
-			'Education Technology' => array( 'label' => __( 'Education Technology', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
195
-			'Higher Education' => array( 'label' => __( 'Higher Education', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
196
-			'K-12' => array( 'label' => __( 'K-12', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
197
-			'Language Courses' => array( 'label' => __( 'Language Courses', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
198
-			'Training' => array( 'label' => __( 'Training', 'seriously-simple-podcasting' ), 'group' => __( 'Education', 'seriously-simple-podcasting' ) ),
199
-
200
-			'Automotive' => array( 'label' => __( 'Automotive', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
201
-			'Aviation' => array( 'label' => __( 'Aviation', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
202
-			'Hobbies' => array( 'label' => __( 'Hobbies', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
203
-			'Other Games' => array( 'label' => __( 'Other Games', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
204
-			'Video Games' => array( 'label' => __( 'Video Games', 'seriously-simple-podcasting' ), 'group' => __( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
205
-
206
-			'Local' => array( 'label' => __( 'Local', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
207
-			'National' => array( 'label' => __( 'National', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
208
-			'Non-Profit' => array( 'label' => __( 'Non-Profit', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
209
-			'Regional' => array( 'label' => __( 'Regional', 'seriously-simple-podcasting' ), 'group' => __( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
210
-
211
-			'Alternative Health' => array( 'label' => __( 'Alternative Health', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
212
-			'Fitness & Nutrition' => array( 'label' => __( 'Fitness & Nutrition', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
213
-			'Self-Help' => array( 'label' => __( 'Self-Help', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
214
-			'Sexuality' => array( 'label' => __( 'Sexuality', 'seriously-simple-podcasting' ), 'group' => __( 'Health', 'seriously-simple-podcasting' ) ),
215
-
216
-			'Buddhism' => array( 'label' => __( 'Buddhism', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
217
-			'Christianity' => array( 'label' => __( 'Christianity', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
218
-			'Hinduism' => array( 'label' => __( 'Hinduism', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
219
-			'Islam' => array( 'label' => __( 'Islam', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
220
-			'Judaism' => array( 'label' => __( 'Judaism', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
221
-			'Other' => array( 'label' => __( 'Other', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
222
-			'Spirituality' => array( 'label' => __( 'Spirituality', 'seriously-simple-podcasting' ), 'group' => __( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
223
-
224
-			'Medicine' => array( 'label' => __( 'Medicine', 'seriously-simple-podcasting' ), 'group' => __( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
225
-			'Natural Sciences' => array( 'label' => __( 'Natural Sciences', 'seriously-simple-podcasting' ), 'group' => __( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
226
-			'Social Sciences' => array( 'label' => __( 'Social Sciences', 'seriously-simple-podcasting' ), 'group' => __( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
227
-
228
-			'History' => array( 'label' => __( 'History', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
229
-			'Personal Journals' => array( 'label' => __( 'Personal Journals', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
230
-			'Philosophy' => array( 'label' => __( 'Philosophy', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
231
-			'Places & Travel' => array( 'label' => __( 'Places & Travel', 'seriously-simple-podcasting' ), 'group' => __( 'Society & Culture', 'seriously-simple-podcasting' ) ),
232
-
233
-			'Amateur' => array( 'label' => __( 'Amateur', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
234
-			'College & High School' => array( 'label' => __( 'College & High School', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
235
-			'Outdoor' => array( 'label' => __( 'Outdoor', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
236
-			'Professional' => array( 'label' => __( 'Professional', 'seriously-simple-podcasting' ), 'group' => __( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
237
-
238
-			'Gadgets' => array( 'label' => __( 'Gadgets', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
239
-			'Tech News' => array( 'label' => __( 'Tech News', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
240
-			'Podcasting' => array( 'label' => __( 'Podcasting', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
241
-			'Software How-To' => array( 'label' => __( 'Software How-To', 'seriously-simple-podcasting' ), 'group' => __( 'Technology', 'seriously-simple-podcasting' ) ),
178
+			'' => __ ( '-- None --', 'seriously-simple-podcasting' ),
179
+
180
+			'Design' => array( 'label' => __ ( 'Design', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
181
+			'Fashion & Beauty' => array( 'label' => __ ( 'Fashion & Beauty', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
182
+			'Food' => array( 'label' => __ ( 'Food', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
183
+			'Literature' => array( 'label' => __ ( 'Literature', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
184
+			'Performing Arts' => array( 'label' => __ ( 'Performing Arts', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
185
+			'Visual Arts' => array( 'label' => __ ( 'Visual Arts', 'seriously-simple-podcasting' ), 'group' => __ ( 'Arts', 'seriously-simple-podcasting' ) ),
186
+
187
+			'Business News' => array( 'label' => __ ( 'Business News', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
188
+			'Careers' => array( 'label' => __ ( 'Careers', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
189
+			'Investing' => array( 'label' => __ ( 'Investing', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
190
+			'Management & Marketing' => array( 'label' => __ ( 'Management & Marketing', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
191
+			'Shopping' => array( 'label' => __ ( 'Shopping', 'seriously-simple-podcasting' ), 'group' => __ ( 'Business', 'seriously-simple-podcasting' ) ),
192
+
193
+			'Education' => array( 'label' => __ ( 'Education', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
194
+			'Education Technology' => array( 'label' => __ ( 'Education Technology', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
195
+			'Higher Education' => array( 'label' => __ ( 'Higher Education', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
196
+			'K-12' => array( 'label' => __ ( 'K-12', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
197
+			'Language Courses' => array( 'label' => __ ( 'Language Courses', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
198
+			'Training' => array( 'label' => __ ( 'Training', 'seriously-simple-podcasting' ), 'group' => __ ( 'Education', 'seriously-simple-podcasting' ) ),
199
+
200
+			'Automotive' => array( 'label' => __ ( 'Automotive', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
201
+			'Aviation' => array( 'label' => __ ( 'Aviation', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
202
+			'Hobbies' => array( 'label' => __ ( 'Hobbies', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
203
+			'Other Games' => array( 'label' => __ ( 'Other Games', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
204
+			'Video Games' => array( 'label' => __ ( 'Video Games', 'seriously-simple-podcasting' ), 'group' => __ ( 'Games & Hobbies', 'seriously-simple-podcasting' ) ),
205
+
206
+			'Local' => array( 'label' => __ ( 'Local', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
207
+			'National' => array( 'label' => __ ( 'National', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
208
+			'Non-Profit' => array( 'label' => __ ( 'Non-Profit', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
209
+			'Regional' => array( 'label' => __ ( 'Regional', 'seriously-simple-podcasting' ), 'group' => __ ( 'Government & Organizations', 'seriously-simple-podcasting' ) ),
210
+
211
+			'Alternative Health' => array( 'label' => __ ( 'Alternative Health', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
212
+			'Fitness & Nutrition' => array( 'label' => __ ( 'Fitness & Nutrition', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
213
+			'Self-Help' => array( 'label' => __ ( 'Self-Help', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
214
+			'Sexuality' => array( 'label' => __ ( 'Sexuality', 'seriously-simple-podcasting' ), 'group' => __ ( 'Health', 'seriously-simple-podcasting' ) ),
215
+
216
+			'Buddhism' => array( 'label' => __ ( 'Buddhism', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
217
+			'Christianity' => array( 'label' => __ ( 'Christianity', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
218
+			'Hinduism' => array( 'label' => __ ( 'Hinduism', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
219
+			'Islam' => array( 'label' => __ ( 'Islam', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
220
+			'Judaism' => array( 'label' => __ ( 'Judaism', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
221
+			'Other' => array( 'label' => __ ( 'Other', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
222
+			'Spirituality' => array( 'label' => __ ( 'Spirituality', 'seriously-simple-podcasting' ), 'group' => __ ( 'Religion & Spirituality', 'seriously-simple-podcasting' ) ),
223
+
224
+			'Medicine' => array( 'label' => __ ( 'Medicine', 'seriously-simple-podcasting' ), 'group' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
225
+			'Natural Sciences' => array( 'label' => __ ( 'Natural Sciences', 'seriously-simple-podcasting' ), 'group' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
226
+			'Social Sciences' => array( 'label' => __ ( 'Social Sciences', 'seriously-simple-podcasting' ), 'group' => __ ( 'Science & Medicine', 'seriously-simple-podcasting' ) ),
227
+
228
+			'History' => array( 'label' => __ ( 'History', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
229
+			'Personal Journals' => array( 'label' => __ ( 'Personal Journals', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
230
+			'Philosophy' => array( 'label' => __ ( 'Philosophy', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
231
+			'Places & Travel' => array( 'label' => __ ( 'Places & Travel', 'seriously-simple-podcasting' ), 'group' => __ ( 'Society & Culture', 'seriously-simple-podcasting' ) ),
232
+
233
+			'Amateur' => array( 'label' => __ ( 'Amateur', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
234
+			'College & High School' => array( 'label' => __ ( 'College & High School', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
235
+			'Outdoor' => array( 'label' => __ ( 'Outdoor', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
236
+			'Professional' => array( 'label' => __ ( 'Professional', 'seriously-simple-podcasting' ), 'group' => __ ( 'Sports & Recreation', 'seriously-simple-podcasting' ) ),
237
+
238
+			'Gadgets' => array( 'label' => __ ( 'Gadgets', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
239
+			'Tech News' => array( 'label' => __ ( 'Tech News', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
240
+			'Podcasting' => array( 'label' => __ ( 'Podcasting', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
241
+			'Software How-To' => array( 'label' => __ ( 'Software How-To', 'seriously-simple-podcasting' ), 'group' => __ ( 'Technology', 'seriously-simple-podcasting' ) ),
242 242
 
243 243
 		);
244 244
 
245 245
 		$settings = array();
246 246
 
247
-		$settings['general'] = array(
248
-			'title'					=> __( 'General', 'seriously-simple-podcasting' ),
249
-			'description'			=> __( '', 'seriously-simple-podcasting' ),
247
+		$settings[ 'general' ] = array(
248
+			'title'					=> __ ( 'General', 'seriously-simple-podcasting' ),
249
+			'description'			=> __ ( '', 'seriously-simple-podcasting' ),
250 250
 			'fields'				=> array(
251 251
 				array(
252 252
 					'id' 			=> 'use_post_types',
253
-					'label'			=> __( 'Podcast post types', 'seriously-simple-podcasting' ),
254
-					'description'	=> __( 'Use this setting to enable podcast functions on any post type - this will add all podcast posts from the specified types to your podcast feed.', 'seriously-simple-podcasting' ),
253
+					'label'			=> __ ( 'Podcast post types', 'seriously-simple-podcasting' ),
254
+					'description'	=> __ ( 'Use this setting to enable podcast functions on any post type - this will add all podcast posts from the specified types to your podcast feed.', 'seriously-simple-podcasting' ),
255 255
 					'type'			=> 'checkbox_multi',
256 256
 					'options'		=> $post_type_options,
257 257
 					'default'		=> array(),
258 258
 				),
259 259
 				array(
260 260
 					'id' 			=> 'include_in_main_query',
261
-					'label'			=> __( 'Include podcast in main blog', 'seriously-simple-podcasting' ),
262
-					'description'	=> __( 'This setting may behave differently in each theme, so test it carefully after activation - it will add the \'podcast\' post type to your site\'s main query so that your podcast episodes appear on your home page along with your blog posts.', 'seriously-simple-podcasting' ),
261
+					'label'			=> __ ( 'Include podcast in main blog', 'seriously-simple-podcasting' ),
262
+					'description'	=> __ ( 'This setting may behave differently in each theme, so test it carefully after activation - it will add the \'podcast\' post type to your site\'s main query so that your podcast episodes appear on your home page along with your blog posts.', 'seriously-simple-podcasting' ),
263 263
 					'type'			=> 'checkbox',
264 264
 					'default'		=> '',
265 265
 				),
266 266
 				array(
267 267
 					'id' 			=> 'player_locations',
268
-					'label'			=> __( 'Media player locations', 'seriously-simple-podcasting' ),
269
-					'description'	=> __( 'Select where to show the podcast media player along with the episode data (download link, duration and file size)', 'seriously-simple-podcasting' ),
268
+					'label'			=> __ ( 'Media player locations', 'seriously-simple-podcasting' ),
269
+					'description'	=> __ ( 'Select where to show the podcast media player along with the episode data (download link, duration and file size)', 'seriously-simple-podcasting' ),
270 270
 					'type'			=> 'checkbox_multi',
271
-					'options'		=> array( 'content' => __( 'Full content', 'seriously-simple-podcasting' ), 'excerpt' => __( 'Excerpt', 'seriously-simple-podcasting' ),  'excerpt_embed' => __( 'oEmbed Excerpt', 'seriously-simple-podcasting' ) ),
271
+					'options'		=> array( 'content' => __ ( 'Full content', 'seriously-simple-podcasting' ), 'excerpt' => __ ( 'Excerpt', 'seriously-simple-podcasting' ), 'excerpt_embed' => __ ( 'oEmbed Excerpt', 'seriously-simple-podcasting' ) ),
272 272
 					'default'		=> array(),
273 273
 				),
274 274
 				array(
275 275
 					'id' 			=> 'player_content_location',
276
-					'label'			=> __( 'Media player position', 'seriously-simple-podcasting' ),
277
-					'description'	=> __( 'Select whether to display the media player above or below the full post content.', 'seriously-simple-podcasting' ),
276
+					'label'			=> __ ( 'Media player position', 'seriously-simple-podcasting' ),
277
+					'description'	=> __ ( 'Select whether to display the media player above or below the full post content.', 'seriously-simple-podcasting' ),
278 278
 					'type'			=> 'radio',
279
-					'options'		=> array( 'above' => __( 'Above content', 'seriously-simple-podcasting' ), 'below' => __( 'Below content', 'seriously-simple-podcasting' ) ),
279
+					'options'		=> array( 'above' => __ ( 'Above content', 'seriously-simple-podcasting' ), 'below' => __ ( 'Below content', 'seriously-simple-podcasting' ) ),
280 280
 					'default'		=> 'above',
281 281
 				),
282 282
 				array(
283 283
 					'id' 			=> 'player_content_visibility',
284
-					'label'			=> __( 'Media player visibility', 'seriously-simple-podcasting' ),
285
-					'description'	=> __( 'Select whether to display the media player to everybody or only logged in users.', 'seriously-simple-podcasting' ),
284
+					'label'			=> __ ( 'Media player visibility', 'seriously-simple-podcasting' ),
285
+					'description'	=> __ ( 'Select whether to display the media player to everybody or only logged in users.', 'seriously-simple-podcasting' ),
286 286
 					'type'			=> 'radio',
287
-					'options'		=> array( 'all' => __( 'Everybody', 'seriously-simple-podcasting' ), 'membersonly' => __( 'Only logged in users', 'seriously-simple-podcasting' ) ),
287
+					'options'		=> array( 'all' => __ ( 'Everybody', 'seriously-simple-podcasting' ), 'membersonly' => __ ( 'Only logged in users', 'seriously-simple-podcasting' ) ),
288 288
 					'default'		=> 'all',
289 289
 				),
290 290
 			),
291 291
 		);
292 292
 
293
-		$settings['feed-details'] = array(
294
-			'title'					=> __( 'Feed details', 'seriously-simple-podcasting' ),
295
-			'description'			=> sprintf( __( 'This data will be used in the feed for your podcast so your listeners will know more about it before they subscribe.%1$sAll of these fields are optional, but it is recommended that you fill in as many of them as possible. Blank fields will use the assigned defaults in the feed.%2$s', 'seriously-simple-podcasting' ), '<br/><em>', '</em>' ),
293
+		$settings[ 'feed-details' ] = array(
294
+			'title'					=> __ ( 'Feed details', 'seriously-simple-podcasting' ),
295
+			'description'			=> sprintf ( __ ( 'This data will be used in the feed for your podcast so your listeners will know more about it before they subscribe.%1$sAll of these fields are optional, but it is recommended that you fill in as many of them as possible. Blank fields will use the assigned defaults in the feed.%2$s', 'seriously-simple-podcasting' ), '<br/><em>', '</em>' ),
296 296
 			'fields'				=> array(
297 297
 				array(
298 298
 					'id' 			=> 'data_title',
299
-					'label'			=> __( 'Title' , 'seriously-simple-podcasting' ),
300
-					'description'	=> __( 'Your podcast title.', 'seriously-simple-podcasting' ),
299
+					'label'			=> __ ( 'Title', 'seriously-simple-podcasting' ),
300
+					'description'	=> __ ( 'Your podcast title.', 'seriously-simple-podcasting' ),
301 301
 					'type'			=> 'text',
302
-					'default'		=> get_bloginfo( 'name' ),
303
-					'placeholder'	=> get_bloginfo( 'name' ),
302
+					'default'		=> get_bloginfo ( 'name' ),
303
+					'placeholder'	=> get_bloginfo ( 'name' ),
304 304
 					'class'			=> 'large-text',
305 305
 					'callback'		=> 'wp_strip_all_tags',
306 306
 				),
307 307
 				array(
308 308
 					'id' 			=> 'data_subtitle',
309
-					'label'			=> __( 'Subtitle' , 'seriously-simple-podcasting' ),
310
-					'description'	=> __( 'Your podcast subtitle.', 'seriously-simple-podcasting' ),
309
+					'label'			=> __ ( 'Subtitle', 'seriously-simple-podcasting' ),
310
+					'description'	=> __ ( 'Your podcast subtitle.', 'seriously-simple-podcasting' ),
311 311
 					'type'			=> 'text',
312
-					'default'		=> get_bloginfo( 'description' ),
313
-					'placeholder'	=> get_bloginfo( 'description' ),
312
+					'default'		=> get_bloginfo ( 'description' ),
313
+					'placeholder'	=> get_bloginfo ( 'description' ),
314 314
 					'class'			=> 'large-text',
315 315
 					'callback'		=> 'wp_strip_all_tags',
316 316
 				),
317 317
 				array(
318 318
 					'id' 			=> 'data_author',
319
-					'label'			=> __( 'Author' , 'seriously-simple-podcasting' ),
320
-					'description'	=> __( 'Your podcast author.', 'seriously-simple-podcasting' ),
319
+					'label'			=> __ ( 'Author', 'seriously-simple-podcasting' ),
320
+					'description'	=> __ ( 'Your podcast author.', 'seriously-simple-podcasting' ),
321 321
 					'type'			=> 'text',
322
-					'default'		=> get_bloginfo( 'name' ),
323
-					'placeholder'	=> get_bloginfo( 'name' ),
322
+					'default'		=> get_bloginfo ( 'name' ),
323
+					'placeholder'	=> get_bloginfo ( 'name' ),
324 324
 					'class'			=> 'large-text',
325 325
 					'callback'		=> 'wp_strip_all_tags',
326 326
 				),
327 327
 				array(
328 328
 					'id' 			=> 'data_category',
329
-					'label'			=> __( 'Primary Category' , 'seriously-simple-podcasting' ),
330
-					'description'	=> __( 'Your podcast\'s primary category.', 'seriously-simple-podcasting' ),
329
+					'label'			=> __ ( 'Primary Category', 'seriously-simple-podcasting' ),
330
+					'description'	=> __ ( 'Your podcast\'s primary category.', 'seriously-simple-podcasting' ),
331 331
 					'type'			=> 'select',
332 332
 					'options'		=> $category_options,
333 333
 					'default'		=> '',
@@ -335,8 +335,8 @@  discard block
 block discarded – undo
335 335
 				),
336 336
 				array(
337 337
 					'id' 			=> 'data_subcategory',
338
-					'label'			=> __( 'Primary Sub-Category' , 'seriously-simple-podcasting' ),
339
-					'description'	=> __( 'Your podcast\'s primary sub-category (if available) - must be a sub-category of the primary category selected above.', 'seriously-simple-podcasting' ),
338
+					'label'			=> __ ( 'Primary Sub-Category', 'seriously-simple-podcasting' ),
339
+					'description'	=> __ ( 'Your podcast\'s primary sub-category (if available) - must be a sub-category of the primary category selected above.', 'seriously-simple-podcasting' ),
340 340
 					'type'			=> 'select',
341 341
 					'options'		=> $subcategory_options,
342 342
 					'default'		=> '',
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
 				),
345 345
 				array(
346 346
 					'id' 			=> 'data_category2',
347
-					'label'			=> __( 'Secondary Category' , 'seriously-simple-podcasting' ),
348
-					'description'	=> __( 'Your podcast\'s secondary category.', 'seriously-simple-podcasting' ),
347
+					'label'			=> __ ( 'Secondary Category', 'seriously-simple-podcasting' ),
348
+					'description'	=> __ ( 'Your podcast\'s secondary category.', 'seriously-simple-podcasting' ),
349 349
 					'type'			=> 'select',
350 350
 					'options'		=> $category_options,
351 351
 					'default'		=> '',
@@ -353,8 +353,8 @@  discard block
 block discarded – undo
353 353
 				),
354 354
 				array(
355 355
 					'id' 			=> 'data_subcategory2',
356
-					'label'			=> __( 'Secondary Sub-Category' , 'seriously-simple-podcasting' ),
357
-					'description'	=> __( 'Your podcast\'s secondary sub-category (if available) - must be a sub-category of the secondary category selected above.', 'seriously-simple-podcasting' ),
356
+					'label'			=> __ ( 'Secondary Sub-Category', 'seriously-simple-podcasting' ),
357
+					'description'	=> __ ( 'Your podcast\'s secondary sub-category (if available) - must be a sub-category of the secondary category selected above.', 'seriously-simple-podcasting' ),
358 358
 					'type'			=> 'select',
359 359
 					'options'		=> $subcategory_options,
360 360
 					'default'		=> '',
@@ -362,8 +362,8 @@  discard block
 block discarded – undo
362 362
 				),
363 363
 				array(
364 364
 					'id' 			=> 'data_category3',
365
-					'label'			=> __( 'Tertiary Category' , 'seriously-simple-podcasting' ),
366
-					'description'	=> __( 'Your podcast\'s tertiary category.', 'seriously-simple-podcasting' ),
365
+					'label'			=> __ ( 'Tertiary Category', 'seriously-simple-podcasting' ),
366
+					'description'	=> __ ( 'Your podcast\'s tertiary category.', 'seriously-simple-podcasting' ),
367 367
 					'type'			=> 'select',
368 368
 					'options'		=> $category_options,
369 369
 					'default'		=> '',
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
 				),
372 372
 				array(
373 373
 					'id' 			=> 'data_subcategory3',
374
-					'label'			=> __( 'Tertiary Sub-Category' , 'seriously-simple-podcasting' ),
375
-					'description'	=> __( 'Your podcast\'s tertiary sub-category (if available) - must be a sub-category of the tertiary category selected above.', 'seriously-simple-podcasting' ),
374
+					'label'			=> __ ( 'Tertiary Sub-Category', 'seriously-simple-podcasting' ),
375
+					'description'	=> __ ( 'Your podcast\'s tertiary sub-category (if available) - must be a sub-category of the tertiary category selected above.', 'seriously-simple-podcasting' ),
376 376
 					'type'			=> 'select',
377 377
 					'options'		=> $subcategory_options,
378 378
 					'default'		=> '',
@@ -380,18 +380,18 @@  discard block
 block discarded – undo
380 380
 				),
381 381
 				array(
382 382
 					'id' 			=> 'data_description',
383
-					'label'			=> __( 'Description/Summary' , 'seriously-simple-podcasting' ),
384
-					'description'	=> __( 'A description/summary of your podcast - no HTML allowed.', 'seriously-simple-podcasting' ),
383
+					'label'			=> __ ( 'Description/Summary', 'seriously-simple-podcasting' ),
384
+					'description'	=> __ ( 'A description/summary of your podcast - no HTML allowed.', 'seriously-simple-podcasting' ),
385 385
 					'type'			=> 'textarea',
386
-					'default'		=> get_bloginfo( 'description' ),
387
-					'placeholder'	=> get_bloginfo( 'description' ),
386
+					'default'		=> get_bloginfo ( 'description' ),
387
+					'placeholder'	=> get_bloginfo ( 'description' ),
388 388
 					'callback'		=> 'wp_strip_all_tags',
389 389
 					'class'			=> 'large-text',
390 390
 				),
391 391
 				array(
392 392
 					'id' 			=> 'data_image',
393
-					'label'			=> __( 'Cover Image' , 'seriously-simple-podcasting' ),
394
-					'description'	=> __( 'Your podcast cover image - must have a minimum size of 1400x1400 px.', 'seriously-simple-podcasting' ),
393
+					'label'			=> __ ( 'Cover Image', 'seriously-simple-podcasting' ),
394
+					'description'	=> __ ( 'Your podcast cover image - must have a minimum size of 1400x1400 px.', 'seriously-simple-podcasting' ),
395 395
 					'type'			=> 'image',
396 396
 					'default'		=> '',
397 397
 					'placeholder'	=> '',
@@ -399,182 +399,182 @@  discard block
 block discarded – undo
399 399
 				),
400 400
 				array(
401 401
 					'id' 			=> 'data_owner_name',
402
-					'label'			=> __( 'Owner name' , 'seriously-simple-podcasting' ),
403
-					'description'	=> __( 'Podcast owner\'s name.', 'seriously-simple-podcasting' ),
402
+					'label'			=> __ ( 'Owner name', 'seriously-simple-podcasting' ),
403
+					'description'	=> __ ( 'Podcast owner\'s name.', 'seriously-simple-podcasting' ),
404 404
 					'type'			=> 'text',
405
-					'default'		=> get_bloginfo( 'name' ),
406
-					'placeholder'	=> get_bloginfo( 'name' ),
405
+					'default'		=> get_bloginfo ( 'name' ),
406
+					'placeholder'	=> get_bloginfo ( 'name' ),
407 407
 					'class'			=> 'large-text',
408 408
 					'callback'		=> 'wp_strip_all_tags',
409 409
 				),
410 410
 				array(
411 411
 					'id' 			=> 'data_owner_email',
412
-					'label'			=> __( 'Owner email address' , 'seriously-simple-podcasting' ),
413
-					'description'	=> __( 'Podcast owner\'s email address.', 'seriously-simple-podcasting' ),
412
+					'label'			=> __ ( 'Owner email address', 'seriously-simple-podcasting' ),
413
+					'description'	=> __ ( 'Podcast owner\'s email address.', 'seriously-simple-podcasting' ),
414 414
 					'type'			=> 'text',
415
-					'default'		=> get_bloginfo( 'admin_email' ),
416
-					'placeholder'	=> get_bloginfo( 'admin_email' ),
415
+					'default'		=> get_bloginfo ( 'admin_email' ),
416
+					'placeholder'	=> get_bloginfo ( 'admin_email' ),
417 417
 					'class'			=> 'large-text',
418 418
 					'callback'		=> 'wp_strip_all_tags',
419 419
 				),
420 420
 				array(
421 421
 					'id' 			=> 'data_language',
422
-					'label'			=> __( 'Language' , 'seriously-simple-podcasting' ),
423
-					'description'	=> sprintf( __( 'Your podcast\'s language in %1$sISO-639-1 format%2$s.', 'seriously-simple-podcasting' ), '<a href="' . esc_url( 'http://www.loc.gov/standards/iso639-2/php/code_list.php' ) . '" target="' . wp_strip_all_tags( '_blank' ) . '">', '</a>' ),
422
+					'label'			=> __ ( 'Language', 'seriously-simple-podcasting' ),
423
+					'description'	=> sprintf ( __ ( 'Your podcast\'s language in %1$sISO-639-1 format%2$s.', 'seriously-simple-podcasting' ), '<a href="'.esc_url ( 'http://www.loc.gov/standards/iso639-2/php/code_list.php' ).'" target="'.wp_strip_all_tags ( '_blank' ).'">', '</a>' ),
424 424
 					'type'			=> 'text',
425
-					'default'		=> get_bloginfo( 'language' ),
426
-					'placeholder'	=> get_bloginfo( 'language' ),
425
+					'default'		=> get_bloginfo ( 'language' ),
426
+					'placeholder'	=> get_bloginfo ( 'language' ),
427 427
 					'class'			=> 'all-options',
428 428
 					'callback'		=> 'wp_strip_all_tags',
429 429
 				),
430 430
 				array(
431 431
 					'id' 			=> 'data_copyright',
432
-					'label'			=> __( 'Copyright' , 'seriously-simple-podcasting' ),
433
-					'description'	=> __( 'Copyright line for your podcast.', 'seriously-simple-podcasting' ),
432
+					'label'			=> __ ( 'Copyright', 'seriously-simple-podcasting' ),
433
+					'description'	=> __ ( 'Copyright line for your podcast.', 'seriously-simple-podcasting' ),
434 434
 					'type'			=> 'text',
435
-					'default'		=> '&#xA9; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ),
436
-					'placeholder'	=> '&#xA9; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ),
435
+					'default'		=> '&#xA9; '.date ( 'Y' ).' '.get_bloginfo ( 'name' ),
436
+					'placeholder'	=> '&#xA9; '.date ( 'Y' ).' '.get_bloginfo ( 'name' ),
437 437
 					'class'			=> 'large-text',
438 438
 					'callback'		=> 'wp_strip_all_tags',
439 439
 				),
440 440
 				array(
441 441
 					'id' 			=> 'explicit',
442
-					'label'			=> __( 'Explicit', 'seriously-simple-podcasting' ),
443
-					'description'	=> __( 'Mark if your podcast is explicit or not.', 'seriously-simple-podcasting' ),
442
+					'label'			=> __ ( 'Explicit', 'seriously-simple-podcasting' ),
443
+					'description'	=> __ ( 'Mark if your podcast is explicit or not.', 'seriously-simple-podcasting' ),
444 444
 					'type'			=> 'checkbox',
445 445
 					'default'		=> '',
446 446
 					'callback'		=> 'wp_strip_all_tags',
447 447
 				),
448 448
 				array(
449 449
 					'id' 			=> 'complete',
450
-					'label'			=> __( 'Complete', 'seriously-simple-podcasting' ),
451
-					'description'	=> __( 'Mark if this podcast is complete or not. Only do this if no more episodes are going to be added to this feed.', 'seriously-simple-podcasting' ),
450
+					'label'			=> __ ( 'Complete', 'seriously-simple-podcasting' ),
451
+					'description'	=> __ ( 'Mark if this podcast is complete or not. Only do this if no more episodes are going to be added to this feed.', 'seriously-simple-podcasting' ),
452 452
 					'type'			=> 'checkbox',
453 453
 					'default'		=> '',
454 454
 					'callback'		=> 'wp_strip_all_tags',
455 455
 				),
456 456
 				array(
457 457
 					'id' 			=> 'redirect_feed',
458
-					'label'			=> __( 'Redirect this feed to new URL', 'seriously-simple-podcasting' ),
459
-					'description'	=> sprintf( __( 'Redirect your feed to a new URL (specified below).', 'seriously-simple-podcasting' ) , '<br/>' ),
458
+					'label'			=> __ ( 'Redirect this feed to new URL', 'seriously-simple-podcasting' ),
459
+					'description'	=> sprintf ( __ ( 'Redirect your feed to a new URL (specified below).', 'seriously-simple-podcasting' ), '<br/>' ),
460 460
 					'type'			=> 'checkbox',
461 461
 					'default'		=> '',
462 462
 					'callback'		=> 'wp_strip_all_tags',
463 463
 				),
464 464
 				array(
465 465
 					'id' 			=> 'new_feed_url',
466
-					'label'			=> __( 'New podcast feed URL', 'seriously-simple-podcasting' ),
467
-					'description'	=> __( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
466
+					'label'			=> __ ( 'New podcast feed URL', 'seriously-simple-podcasting' ),
467
+					'description'	=> __ ( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
468 468
 					'type'			=> 'text',
469 469
 					'default'		=> '',
470
-					'placeholder'	=> __( 'New feed URL', 'seriously-simple-podcasting' ),
470
+					'placeholder'	=> __ ( 'New feed URL', 'seriously-simple-podcasting' ),
471 471
 					'callback'		=> 'esc_url_raw',
472 472
 					'class'			=> 'regular-text',
473 473
 				),
474 474
 			)
475 475
 		);
476 476
 
477
-		$settings['security'] = array(
478
-			'title'					=> __( 'Security', 'seriously-simple-podcasting' ),
479
-			'description'			=> __( 'Change these settings to ensure that your podcast feed remains private. This will block feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
477
+		$settings[ 'security' ] = array(
478
+			'title'					=> __ ( 'Security', 'seriously-simple-podcasting' ),
479
+			'description'			=> __ ( 'Change these settings to ensure that your podcast feed remains private. This will block feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
480 480
 			'fields'				=> array(
481 481
 				array(
482 482
 					'id' 			=> 'protect',
483
-					'label'			=> __( 'Password protect your podcast feed', 'seriously-simple-podcasting' ),
484
-					'description'	=> __( 'Mark if you would like to password protect your podcast feed - you can set the username and password below. This will block all feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
483
+					'label'			=> __ ( 'Password protect your podcast feed', 'seriously-simple-podcasting' ),
484
+					'description'	=> __ ( 'Mark if you would like to password protect your podcast feed - you can set the username and password below. This will block all feed readers (including iTunes) from accessing your feed.', 'seriously-simple-podcasting' ),
485 485
 					'type'			=> 'checkbox',
486 486
 					'default'		=> '',
487 487
 					'callback'		=> 'wp_strip_all_tags',
488 488
 				),
489 489
 				array(
490 490
 					'id' 			=> 'protection_username',
491
-					'label'			=> __( 'Username' , 'seriously-simple-podcasting' ),
492
-					'description'	=> __( 'Username for your podcast feed.', 'seriously-simple-podcasting' ),
491
+					'label'			=> __ ( 'Username', 'seriously-simple-podcasting' ),
492
+					'description'	=> __ ( 'Username for your podcast feed.', 'seriously-simple-podcasting' ),
493 493
 					'type'			=> 'text',
494 494
 					'default'		=> '',
495
-					'placeholder'	=> __( 'Feed username', 'seriously-simple-podcasting' ),
495
+					'placeholder'	=> __ ( 'Feed username', 'seriously-simple-podcasting' ),
496 496
 					'class'			=> 'regular-text',
497 497
 					'callback'		=> 'wp_strip_all_tags',
498 498
 				),
499 499
 				array(
500 500
 					'id' 			=> 'protection_password',
501
-					'label'			=> __( 'Password' , 'seriously-simple-podcasting' ),
502
-					'description'	=> __( 'Password for your podcast feed. Once saved, the password is encoded and secured so it will not be visible on this page again.', 'seriously-simple-podcasting' ),
501
+					'label'			=> __ ( 'Password', 'seriously-simple-podcasting' ),
502
+					'description'	=> __ ( 'Password for your podcast feed. Once saved, the password is encoded and secured so it will not be visible on this page again.', 'seriously-simple-podcasting' ),
503 503
 					'type'			=> 'text_secret',
504 504
 					'default'		=> '',
505
-					'placeholder'	=> __( 'Feed password', 'seriously-simple-podcasting' ),
505
+					'placeholder'	=> __ ( 'Feed password', 'seriously-simple-podcasting' ),
506 506
 					'callback'		=> array( $this, 'encode_password' ),
507 507
 					'class'			=> 'regular-text',
508 508
 				),
509 509
 				array(
510 510
 					'id' 			=> 'protection_no_access_message',
511
-					'label'			=> __( 'No access message' , 'seriously-simple-podcasting' ),
512
-					'description'	=> __( 'This message will be displayed to people who are not allowed access to your podcast feed. Limited HTML allowed.', 'seriously-simple-podcasting' ),
511
+					'label'			=> __ ( 'No access message', 'seriously-simple-podcasting' ),
512
+					'description'	=> __ ( 'This message will be displayed to people who are not allowed access to your podcast feed. Limited HTML allowed.', 'seriously-simple-podcasting' ),
513 513
 					'type'			=> 'textarea',
514
-					'default'		=> __( 'You are not permitted to view this podcast feed.', 'seriously-simple-podcasting' ),
515
-					'placeholder'	=> __( 'Message displayed to users who do not have access to the podcast feed', 'seriously-simple-podcasting' ),
514
+					'default'		=> __ ( 'You are not permitted to view this podcast feed.', 'seriously-simple-podcasting' ),
515
+					'placeholder'	=> __ ( 'Message displayed to users who do not have access to the podcast feed', 'seriously-simple-podcasting' ),
516 516
 					'callback'		=> array( $this, 'validate_message' ),
517 517
 					'class'			=> 'large-text',
518 518
 				),
519 519
 			)
520 520
 		);
521 521
 
522
-		$settings['redirection'] = array(
523
-			'title'					=> __( 'Redirection', 'seriously-simple-podcasting' ),
524
-			'description'			=> __( 'Use these settings to safely move your podcast to a different location. Only do this once your new podcast is setup and active.', 'seriously-simple-podcasting' ),
522
+		$settings[ 'redirection' ] = array(
523
+			'title'					=> __ ( 'Redirection', 'seriously-simple-podcasting' ),
524
+			'description'			=> __ ( 'Use these settings to safely move your podcast to a different location. Only do this once your new podcast is setup and active.', 'seriously-simple-podcasting' ),
525 525
 			'fields'				=> array(
526 526
 				array(
527 527
 					'id' 			=> 'redirect_feed',
528
-					'label'			=> __( 'Redirect podcast feed to new URL', 'seriously-simple-podcasting' ),
529
-					'description'	=> sprintf( __( 'Redirect your feed to a new URL (specified below).%1$sThis will inform all podcasting services that your podcast has moved and 48 hours after you have saved this option it will permanently redirect your feed to the new URL.', 'seriously-simple-podcasting' ) , '<br/>' ),
528
+					'label'			=> __ ( 'Redirect podcast feed to new URL', 'seriously-simple-podcasting' ),
529
+					'description'	=> sprintf ( __ ( 'Redirect your feed to a new URL (specified below).%1$sThis will inform all podcasting services that your podcast has moved and 48 hours after you have saved this option it will permanently redirect your feed to the new URL.', 'seriously-simple-podcasting' ), '<br/>' ),
530 530
 					'type'			=> 'checkbox',
531 531
 					'default'		=> '',
532 532
 					'callback'		=> 'wp_strip_all_tags',
533 533
 				),
534 534
 				array(
535 535
 					'id' 			=> 'new_feed_url',
536
-					'label'			=> __( 'New podcast feed URL', 'seriously-simple-podcasting' ),
537
-					'description'	=> __( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
536
+					'label'			=> __ ( 'New podcast feed URL', 'seriously-simple-podcasting' ),
537
+					'description'	=> __ ( 'Your podcast feed\'s new URL.', 'seriously-simple-podcasting' ),
538 538
 					'type'			=> 'text',
539 539
 					'default'		=> '',
540
-					'placeholder'	=> __( 'New feed URL', 'seriously-simple-podcasting' ),
540
+					'placeholder'	=> __ ( 'New feed URL', 'seriously-simple-podcasting' ),
541 541
 					'callback'		=> 'esc_url_raw',
542 542
 					'class'			=> 'regular-text',
543 543
 				),
544 544
 			)
545 545
 		);
546 546
 
547
-		$settings['publishing'] = array(
548
-			'title'					=> __( 'Publishing' , 'seriously-simple-podcasting' ),
549
-			'description'			=> __( 'Use these URLs to share and publish your podcast feed. These URLs will work with any podcasting service (including iTunes).' , 'seriously-simple-podcasting' ),
547
+		$settings[ 'publishing' ] = array(
548
+			'title'					=> __ ( 'Publishing', 'seriously-simple-podcasting' ),
549
+			'description'			=> __ ( 'Use these URLs to share and publish your podcast feed. These URLs will work with any podcasting service (including iTunes).', 'seriously-simple-podcasting' ),
550 550
 			'fields'				=> array(
551 551
 				array(
552 552
 					'id' 			=> 'feed_url',
553
-					'label'			=> __( 'External feed URL', 'seriously-simple-podcasting' ),
554
-					'description'	=> __( 'If you are syndicating your podcast using a third-party service (like Feedburner) you can insert the URL here, otherwise this must be left blank.' , 'seriously-simple-podcasting' ),
553
+					'label'			=> __ ( 'External feed URL', 'seriously-simple-podcasting' ),
554
+					'description'	=> __ ( 'If you are syndicating your podcast using a third-party service (like Feedburner) you can insert the URL here, otherwise this must be left blank.', 'seriously-simple-podcasting' ),
555 555
 					'type'			=> 'text',
556 556
 					'default'		=> '',
557
-					'placeholder'	=> __( 'External feed URL', 'seriously-simple-podcasting' ),
557
+					'placeholder'	=> __ ( 'External feed URL', 'seriously-simple-podcasting' ),
558 558
 					'callback'		=> 'esc_url_raw',
559 559
 					'class'			=> 'regular-text',
560 560
 				),
561 561
 				array(
562 562
 					'id' 			=> 'feed_link',
563
-					'label'			=> __( 'Complete feed', 'seriously-simple-podcasting' ),
563
+					'label'			=> __ ( 'Complete feed', 'seriously-simple-podcasting' ),
564 564
 					'description'	=> '',
565 565
 					'type'			=> 'feed_link',
566 566
 					'callback'		=> 'esc_url_raw',
567 567
 				),
568 568
 				array(
569 569
 					'id' 			=> 'feed_link_series',
570
-					'label'			=> __( 'Feed for a specific series', 'seriously-simple-podcasting' ),
570
+					'label'			=> __ ( 'Feed for a specific series', 'seriously-simple-podcasting' ),
571 571
 					'description'	=> '',
572 572
 					'type'			=> 'feed_link_series',
573 573
 					'callback'		=> 'esc_url_raw',
574 574
 				),
575 575
 				array(
576 576
 					'id' 			=> 'podcast_url',
577
-					'label'			=> __( 'Podcast page', 'seriously-simple-podcasting' ),
577
+					'label'			=> __ ( 'Podcast page', 'seriously-simple-podcasting' ),
578 578
 					'description'	=> '',
579 579
 					'type'			=> 'podcast_url',
580 580
 					'callback'		=> 'esc_url_raw',
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 			)
583 583
 		);
584 584
 
585
-		$settings = apply_filters( 'ssp_settings_fields', $settings );
585
+		$settings = apply_filters ( 'ssp_settings_fields', $settings );
586 586
 
587 587
 		return $settings;
588 588
 	}
@@ -592,15 +592,15 @@  discard block
 block discarded – undo
592 592
 	 * @return void
593 593
 	 */
594 594
 	public function register_settings() {
595
-		if ( is_array( $this->settings ) ) {
595
+		if ( is_array ( $this->settings ) ) {
596 596
 
597 597
 			// Check posted/selected tab
598 598
 			$current_section = 'general';
599
-			if ( isset( $_POST['tab'] ) && $_POST['tab'] ) {
600
-				$current_section = $_POST['tab'];
599
+			if ( isset( $_POST[ 'tab' ] ) && $_POST[ 'tab' ] ) {
600
+				$current_section = $_POST[ 'tab' ];
601 601
 			} else {
602
-				if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {
603
-					$current_section = $_GET['tab'];
602
+				if ( isset( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] ) {
603
+					$current_section = $_GET[ 'tab' ];
604 604
 				}
605 605
 			}
606 606
 
@@ -615,81 +615,81 @@  discard block
 block discarded – undo
615 615
 				$series_id = 0;
616 616
 				if ( 'feed-details' == $section ) {
617 617
 
618
-					if ( isset( $_REQUEST['feed-series'] ) && $_REQUEST['feed-series'] && 'default' != $_REQUEST['feed-series'] ) {
618
+					if ( isset( $_REQUEST[ 'feed-series' ] ) && $_REQUEST[ 'feed-series' ] && 'default' != $_REQUEST[ 'feed-series' ] ) {
619 619
 
620 620
 						// Get selected series
621
-						$series = get_term_by( 'slug', esc_attr( $_REQUEST['feed-series'] ), 'series' );
621
+						$series = get_term_by ( 'slug', esc_attr ( $_REQUEST[ 'feed-series' ] ), 'series' );
622 622
 
623 623
 						// Store series ID for later use
624 624
 						$series_id = $series->term_id;
625 625
 
626 626
 						// Append series name to section title
627 627
 						if ( $series ) {
628
-							$title_tail = ': ' . $series->name;
628
+							$title_tail = ': '.$series->name;
629 629
 						}
630 630
 					}
631 631
 				}
632 632
 
633
-				$section_title = $data['title'] . $title_tail;
633
+				$section_title = $data[ 'title' ].$title_tail;
634 634
 
635 635
 				// Add section to page
636
-				add_settings_section( $section, $section_title, array( $this, 'settings_section' ), 'ss_podcasting' );
636
+				add_settings_section ( $section, $section_title, array( $this, 'settings_section' ), 'ss_podcasting' );
637 637
 
638
-				foreach ( $data['fields'] as $field ) {
638
+				foreach ( $data[ 'fields' ] as $field ) {
639 639
 
640 640
 					// Validation callback for field
641 641
 					$validation = '';
642
-					if ( isset( $field['callback'] ) ) {
643
-						$validation = $field['callback'];
642
+					if ( isset( $field[ 'callback' ] ) ) {
643
+						$validation = $field[ 'callback' ];
644 644
 					}
645 645
 
646 646
 					// Get field option name
647
-					$option_name = $this->settings_base . $field['id'];
647
+					$option_name = $this->settings_base.$field[ 'id' ];
648 648
 
649 649
 					// Append series ID if selected
650 650
 					if ( $series_id ) {
651
-						$option_name .= '_' . $series_id;
651
+						$option_name .= '_'.$series_id;
652 652
 					}
653 653
 
654 654
 					// Register setting
655
-					register_setting( 'ss_podcasting', $option_name, $validation );
655
+					register_setting ( 'ss_podcasting', $option_name, $validation );
656 656
 
657 657
 					// Add field to page
658
-					add_settings_field( $field['id'], $field['label'], array( $this, 'display_field' ), 'ss_podcasting', $section, array( 'field' => $field, 'prefix' => $this->settings_base, 'feed-series' => $series_id ) );
658
+					add_settings_field ( $field[ 'id' ], $field[ 'label' ], array( $this, 'display_field' ), 'ss_podcasting', $section, array( 'field' => $field, 'prefix' => $this->settings_base, 'feed-series' => $series_id ) );
659 659
 				}
660 660
 			}
661 661
 		}
662 662
 	}
663 663
 
664 664
 	public function settings_section( $section ) {
665
-		$html = '<p>' . $this->settings[ $section['id'] ]['description'] . '</p>' . "\n";
665
+		$html = '<p>'.$this->settings[ $section[ 'id' ] ][ 'description' ].'</p>'."\n";
666 666
 
667
-		if( 'feed-details' == $section['id'] ) {
667
+		if ( 'feed-details' == $section[ 'id' ] ) {
668 668
 
669 669
 			$feed_series = 'default';
670
-			if( isset( $_GET['feed-series'] ) ) {
671
-				$feed_series = esc_attr( $_GET['feed-series'] );
670
+			if ( isset( $_GET[ 'feed-series' ] ) ) {
671
+				$feed_series = esc_attr ( $_GET[ 'feed-series' ] );
672 672
 			}
673 673
 
674
-			$permalink_structure = get_option( 'permalink_structure' );
674
+			$permalink_structure = get_option ( 'permalink_structure' );
675 675
 
676 676
 			if ( $permalink_structure ) {
677
-				$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
678
-				$feed_url = $this->home_url . 'feed/' . $feed_slug;
677
+				$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
678
+				$feed_url = $this->home_url.'feed/'.$feed_slug;
679 679
 			} else {
680
-				$feed_url = $this->home_url . '?feed=' . $this->token;
680
+				$feed_url = $this->home_url.'?feed='.$this->token;
681 681
 			}
682 682
 
683
-			if( $feed_series && $feed_series != 'default' ) {
683
+			if ( $feed_series && $feed_series != 'default' ) {
684 684
 				if ( $permalink_structure ) {
685
-					$feed_url .= '/' . $feed_series;
685
+					$feed_url .= '/'.$feed_series;
686 686
 				} else {
687
-					$feed_url .= '&podcast_series=' . $feed_series;
687
+					$feed_url .= '&podcast_series='.$feed_series;
688 688
 				}
689 689
 			}
690 690
 
691
-			if( $feed_url ) {
692
-				$html .= '<p><a class="view-feed-link" href="' . esc_url( $feed_url ) . '" target="_blank"><span class="dashicons dashicons-rss"></span>' . __( 'View feed', 'seriously-simple-podcasting' ) . '</a></p>' . "\n";
691
+			if ( $feed_url ) {
692
+				$html .= '<p><a class="view-feed-link" href="'.esc_url ( $feed_url ).'" target="_blank"><span class="dashicons dashicons-rss"></span>'.__ ( 'View feed', 'seriously-simple-podcasting' ).'</a></p>'."\n";
693 693
 			}
694 694
 
695 695
 		}
@@ -704,116 +704,116 @@  discard block
 block discarded – undo
704 704
 	 */
705 705
 	public function display_field( $args ) {
706 706
 
707
-		$field = $args['field'];
707
+		$field = $args[ 'field' ];
708 708
 
709 709
 		$html = '';
710 710
 
711 711
 		// Get option name
712
-		$option_name = $this->settings_base . $field['id'];
712
+		$option_name = $this->settings_base.$field[ 'id' ];
713 713
 		$default_option_name = $option_name;
714 714
 
715 715
 		// Get field default
716 716
 		$default = '';
717
-		if ( isset( $field['default'] ) ) {
718
-			$default = $field['default'];
717
+		if ( isset( $field[ 'default' ] ) ) {
718
+			$default = $field[ 'default' ];
719 719
 		}
720 720
 
721 721
 		// Get option value
722
-		$data = get_option( $option_name, $default );
722
+		$data = get_option ( $option_name, $default );
723 723
 
724 724
 		// Get specific series data if applicable
725
-		if ( isset( $args['feed-series'] ) && $args['feed-series'] ) {
725
+		if ( isset( $args[ 'feed-series' ] ) && $args[ 'feed-series' ] ) {
726 726
 
727 727
 			$option_default = '';
728 728
 
729 729
 			// Set placeholder to default feed option with specified default fallback
730 730
 			if ( $data ) {
731
-				$field['placeholder'] = $data;
731
+				$field[ 'placeholder' ] = $data;
732 732
 
733
-				if ( in_array( $field['type'], array( 'checkbox', 'select', 'image' ) ) ) {
733
+				if ( in_array ( $field[ 'type' ], array( 'checkbox', 'select', 'image' ) ) ) {
734 734
 					$option_default = $data;
735 735
 				}
736 736
 			}
737 737
 
738 738
 			// Append series ID to option name
739
-			$option_name .= '_' . $args['feed-series'];
739
+			$option_name .= '_'.$args[ 'feed-series' ];
740 740
 
741 741
 			// Get series-sepcific option
742
-			$data = get_option( $option_name, $option_default );
742
+			$data = get_option ( $option_name, $option_default );
743 743
 
744 744
 		}
745 745
 
746 746
 		// Get field class if supplied
747 747
 		$class = '';
748
-		if ( isset( $field['class'] ) ) {
749
-			$class = $field['class'];
748
+		if ( isset( $field[ 'class' ] ) ) {
749
+			$class = $field[ 'class' ];
750 750
 		}
751 751
 
752 752
 		// Get parent class if supplied
753 753
 		$parent_class = '';
754
-		if ( isset( $field['parent_class'] ) ) {
755
-			$parent_class = $field['parent_class'];
754
+		if ( isset( $field[ 'parent_class' ] ) ) {
755
+			$parent_class = $field[ 'parent_class' ];
756 756
 		}
757 757
 
758
-		switch( $field['type'] ) {
758
+		switch ( $field[ 'type' ] ) {
759 759
 			case 'text':
760 760
 			case 'password':
761 761
 			case 'number':
762
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="' . $field['type'] . '" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $field['placeholder'] ) . '" value="' . esc_attr( $data ) . '" class="' . $class . '"/>' . "\n";
762
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="'.$field[ 'type' ].'" name="'.esc_attr ( $option_name ).'" placeholder="'.esc_attr ( $field[ 'placeholder' ] ).'" value="'.esc_attr ( $data ).'" class="'.$class.'"/>'."\n";
763 763
 			break;
764 764
 
765 765
 			case 'text_secret':
766
-				$placeholder = $field['placeholder'];
766
+				$placeholder = $field[ 'placeholder' ];
767 767
 				if ( $data ) {
768
-					$placeholder = __( 'Password stored securely', 'seriously-simple-podcasting' );
768
+					$placeholder = __ ( 'Password stored securely', 'seriously-simple-podcasting' );
769 769
 				}
770
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="text" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $placeholder ) . '" value="" class="' . $class . '"/>' . "\n";
770
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="text" name="'.esc_attr ( $option_name ).'" placeholder="'.esc_attr ( $placeholder ).'" value="" class="'.$class.'"/>'."\n";
771 771
 			break;
772 772
 
773 773
 			case 'textarea':
774
-				$html .= '<textarea id="' . esc_attr( $field['id'] ) . '" rows="5" cols="50" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $field['placeholder'] ) . '" class="' . $class . '">' . $data . '</textarea><br/>'. "\n";
774
+				$html .= '<textarea id="'.esc_attr ( $field[ 'id' ] ).'" rows="5" cols="50" name="'.esc_attr ( $option_name ).'" placeholder="'.esc_attr ( $field[ 'placeholder' ] ).'" class="'.$class.'">'.$data.'</textarea><br/>'."\n";
775 775
 			break;
776 776
 
777 777
 			case 'checkbox':
778 778
 				$checked = '';
779
-				if ( $data && 'on' == $data ){
779
+				if ( $data && 'on' == $data ) {
780 780
 					$checked = 'checked="checked"';
781 781
 				}
782
-				$html .= '<input id="' . esc_attr( $field['id'] ) . '" type="' . $field['type'] . '" name="' . esc_attr( $option_name ) . '" ' . $checked . ' class="' . $class . '"/>' . "\n";
782
+				$html .= '<input id="'.esc_attr ( $field[ 'id' ] ).'" type="'.$field[ 'type' ].'" name="'.esc_attr ( $option_name ).'" '.$checked.' class="'.$class.'"/>'."\n";
783 783
 			break;
784 784
 
785 785
 			case 'checkbox_multi':
786
-				foreach ( $field['options'] as $k => $v ) {
786
+				foreach ( $field[ 'options' ] as $k => $v ) {
787 787
 					$checked = false;
788
-					if ( in_array( $k, (array) $data ) ) {
788
+					if ( in_array ( $k, (array) $data ) ) {
789 789
 						$checked = true;
790 790
 					}
791
-					$html .= '<label for="' . esc_attr( $field['id'] . '_' . $k ) . '"><input type="checkbox" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $option_name ) . '[]" value="' . esc_attr( $k ) . '" id="' . esc_attr( $field['id'] . '_' . $k ) . '" class="' . $class . '" /> ' . $v . '</label><br/>';
791
+					$html .= '<label for="'.esc_attr ( $field[ 'id' ].'_'.$k ).'"><input type="checkbox" '.checked ( $checked, true, false ).' name="'.esc_attr ( $option_name ).'[]" value="'.esc_attr ( $k ).'" id="'.esc_attr ( $field[ 'id' ].'_'.$k ).'" class="'.$class.'" /> '.$v.'</label><br/>';
792 792
 				}
793 793
 			break;
794 794
 
795 795
 			case 'radio':
796
-				foreach ( $field['options'] as $k => $v ) {
796
+				foreach ( $field[ 'options' ] as $k => $v ) {
797 797
 					$checked = false;
798 798
 					if ( $k == $data ) {
799 799
 						$checked = true;
800 800
 					}
801
-					$html .= '<label for="' . esc_attr( $field['id'] . '_' . $k ) . '"><input type="radio" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $option_name ) . '" value="' . esc_attr( $k ) . '" id="' . esc_attr( $field['id'] . '_' . $k ) . '" class="' . $class . '" /> ' . $v . '</label><br/>';
801
+					$html .= '<label for="'.esc_attr ( $field[ 'id' ].'_'.$k ).'"><input type="radio" '.checked ( $checked, true, false ).' name="'.esc_attr ( $option_name ).'" value="'.esc_attr ( $k ).'" id="'.esc_attr ( $field[ 'id' ].'_'.$k ).'" class="'.$class.'" /> '.$v.'</label><br/>';
802 802
 				}
803 803
 			break;
804 804
 
805 805
 			case 'select':
806 806
 
807
-				$html .= '<select name="' . esc_attr( $option_name ) . '" id="' . esc_attr( $field['id'] ) . '" class="' . $class . '">';
807
+				$html .= '<select name="'.esc_attr ( $option_name ).'" id="'.esc_attr ( $field[ 'id' ] ).'" class="'.$class.'">';
808 808
 				$prev_group = '';
809
-				foreach ( $field['options'] as $k => $v ) {
809
+				foreach ( $field[ 'options' ] as $k => $v ) {
810 810
 
811 811
 					$group = '';
812
-					if ( is_array( $v ) ) {
813
-						if ( isset( $v['group'] ) ) {
814
-							$group = $v['group'];
812
+					if ( is_array ( $v ) ) {
813
+						if ( isset( $v[ 'group' ] ) ) {
814
+							$group = $v[ 'group' ];
815 815
 						}
816
-						$v = $v['label'];
816
+						$v = $v[ 'label' ];
817 817
 					}
818 818
 
819 819
 					if ( $prev_group && $group != $prev_group ) {
@@ -826,10 +826,10 @@  discard block
 block discarded – undo
826 826
 					}
827 827
 
828 828
 					if ( $group && $group != $prev_group ) {
829
-						$html .= '<optgroup label="' . esc_attr( $group ) . '">';
829
+						$html .= '<optgroup label="'.esc_attr ( $group ).'">';
830 830
 					}
831 831
 
832
-					$html .= '<option ' . selected( $selected, true, false ) . ' value="' . esc_attr( $k ) . '">' . esc_html( $v ) . '</option>';
832
+					$html .= '<option '.selected ( $selected, true, false ).' value="'.esc_attr ( $k ).'">'.esc_html ( $v ).'</option>';
833 833
 
834 834
 					$prev_group = $group;
835 835
 				}
@@ -837,65 +837,65 @@  discard block
 block discarded – undo
837 837
 			break;
838 838
 
839 839
 			case 'image':
840
-				$html .= '<img id="' . esc_attr( $default_option_name ) . '_preview" src="' . esc_attr( $data ) . '" style="max-width:400px;height:auto;" /><br/>' . "\n";
841
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '_button" type="button" class="button" value="'. __( 'Upload new image' , 'seriously-simple-podcasting' ) . '" />' . "\n";
842
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '_delete" type="button" class="button" value="'. __( 'Remove image' , 'seriously-simple-podcasting' ) . '" />' . "\n";
843
-				$html .= '<input id="' . esc_attr( $default_option_name ) . '" type="hidden" name="' . esc_attr( $option_name ) . '" value="' . esc_attr( $data ) . '"/><br/>' . "\n";
840
+				$html .= '<img id="'.esc_attr ( $default_option_name ).'_preview" src="'.esc_attr ( $data ).'" style="max-width:400px;height:auto;" /><br/>'."\n";
841
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'_button" type="button" class="button" value="'.__ ( 'Upload new image', 'seriously-simple-podcasting' ).'" />'."\n";
842
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'_delete" type="button" class="button" value="'.__ ( 'Remove image', 'seriously-simple-podcasting' ).'" />'."\n";
843
+				$html .= '<input id="'.esc_attr ( $default_option_name ).'" type="hidden" name="'.esc_attr ( $option_name ).'" value="'.esc_attr ( $data ).'"/><br/>'."\n";
844 844
 			break;
845 845
 
846 846
 			case 'feed_link':
847 847
 
848 848
 				// Set feed URL based on site's permalink structure
849
-				if ( get_option( 'permalink_structure' ) ) {
850
-					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
851
-					$url = $this->home_url . 'feed/' . $feed_slug;
849
+				if ( get_option ( 'permalink_structure' ) ) {
850
+					$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
851
+					$url = $this->home_url.'feed/'.$feed_slug;
852 852
 				} else {
853
-					$url = $this->home_url . '?feed=' . $this->token;
853
+					$url = $this->home_url.'?feed='.$this->token;
854 854
 				}
855 855
 
856
-				$html .= '<a href="' . esc_url( $url ) . '" target="_blank">' . $url . '</a>';
856
+				$html .= '<a href="'.esc_url ( $url ).'" target="_blank">'.$url.'</a>';
857 857
 			break;
858 858
 
859 859
 			case 'feed_link_series':
860 860
 
861 861
 				// Set feed URL based on site's permalink structure
862
-				if ( get_option( 'permalink_structure' ) ) {
863
-					$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
864
-					$url = $this->home_url . 'feed/' . $feed_slug . '/series-slug';
862
+				if ( get_option ( 'permalink_structure' ) ) {
863
+					$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
864
+					$url = $this->home_url.'feed/'.$feed_slug.'/series-slug';
865 865
 				} else {
866
-					$url = $this->home_url . '?feed=' . $this->token . '&podcast_series=series-slug';
866
+					$url = $this->home_url.'?feed='.$this->token.'&podcast_series=series-slug';
867 867
 				}
868 868
 
869
-				$html .= esc_url( $url ) . "\n";
869
+				$html .= esc_url ( $url )."\n";
870 870
 			break;
871 871
 
872 872
 			case 'podcast_url';
873 873
 
874
-				$slug = apply_filters( 'ssp_archive_slug', __( 'podcast' , 'seriously-simple-podcasting' ) );
875
-				$podcast_url = $this->home_url . $slug;
874
+				$slug = apply_filters ( 'ssp_archive_slug', __ ( 'podcast', 'seriously-simple-podcasting' ) );
875
+				$podcast_url = $this->home_url.$slug;
876 876
 
877
-				$html .= '<a href="' . esc_url( $podcast_url ) . '" target="_blank">' . $podcast_url . '</a>';
877
+				$html .= '<a href="'.esc_url ( $podcast_url ).'" target="_blank">'.$podcast_url.'</a>';
878 878
 			break;
879 879
 
880 880
 		}
881 881
 
882
-		if ( ! in_array( $field['type'], array( 'feed_link', 'feed_link_series', 'podcast_url' ) ) ) {
883
-			switch( $field['type'] ) {
882
+		if ( ! in_array ( $field[ 'type' ], array( 'feed_link', 'feed_link_series', 'podcast_url' ) ) ) {
883
+			switch ( $field[ 'type' ] ) {
884 884
 
885 885
 				case 'checkbox_multi':
886 886
 				case 'radio':
887 887
 				case 'select_multi':
888
-					$html .= '<br/><span class="description">' . esc_attr( $field['description'] ) . '</span>';
888
+					$html .= '<br/><span class="description">'.esc_attr ( $field[ 'description' ] ).'</span>';
889 889
 				break;
890 890
 
891 891
 				default:
892
-					$html .= '<label for="' . esc_attr( $field['id'] ) . '"><span class="description">' . wp_kses_post( $field['description'] ) . '</span></label>' . "\n";
892
+					$html .= '<label for="'.esc_attr ( $field[ 'id' ] ).'"><span class="description">'.wp_kses_post ( $field[ 'description' ] ).'</span></label>'."\n";
893 893
 				break;
894 894
 			}
895 895
 		}
896 896
 
897
-		if( $parent_class ) {
898
-			$html = '<div class="' . $parent_class . '">' . $html . '</div>';
897
+		if ( $parent_class ) {
898
+			$html = '<div class="'.$parent_class.'">'.$html.'</div>';
899 899
 		}
900 900
 
901 901
 		echo $html;
@@ -907,8 +907,8 @@  discard block
 block discarded – undo
907 907
 	 * @return string       Validated string
908 908
 	 */
909 909
 	public function validate_slug( $slug ) {
910
-		if ( $slug && strlen( $slug ) > 0 && $slug != '' ) {
911
-			$slug = urlencode( strtolower( str_replace( ' ' , '-' , $slug ) ) );
910
+		if ( $slug && strlen ( $slug ) > 0 && $slug != '' ) {
911
+			$slug = urlencode ( strtolower ( str_replace ( ' ', '-', $slug ) ) );
912 912
 		}
913 913
 		return $slug;
914 914
 	}
@@ -920,10 +920,10 @@  discard block
 block discarded – undo
920 920
 	 */
921 921
 	public function encode_password( $password ) {
922 922
 
923
-		if ( $password && strlen( $password ) > 0 && $password != '' ) {
924
-			$password = md5( $password );
923
+		if ( $password && strlen ( $password ) > 0 && $password != '' ) {
924
+			$password = md5 ( $password );
925 925
 		} else {
926
-			$option = get_option( 'ss_podcasting_protection_password' );
926
+			$option = get_option ( 'ss_podcasting_protection_password' );
927 927
 			$password = $option;
928 928
 		}
929 929
 
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 			    'p' => array()
952 952
 			);
953 953
 
954
-			$message = wp_kses( $message, $allowed );
954
+			$message = wp_kses ( $message, $allowed );
955 955
 		}
956 956
 
957 957
 		return $message;
@@ -968,8 +968,8 @@  discard block
 block discarded – undo
968 968
 
969 969
 		if ( $option == 'ss_podcasting_redirect_feed' ) {
970 970
 			if ( ( $new_value != $old_value ) && $new_value == 'on' ) {
971
-				$date = time();
972
-				update_option( 'ss_podcasting_redirect_feed_date', $date );
971
+				$date = time ();
972
+				update_option ( 'ss_podcasting_redirect_feed_date', $date );
973 973
 			}
974 974
 		}
975 975
 
@@ -982,64 +982,64 @@  discard block
 block discarded – undo
982 982
 	public function settings_page() {
983 983
 
984 984
 		// Build page HTML
985
-		$html = '<div class="wrap" id="podcast_settings">' . "\n";
986
-			$html .= '<h1>' . __( 'Podcast Settings' , 'seriously-simple-podcasting' ) . '</h1>' . "\n";
985
+		$html = '<div class="wrap" id="podcast_settings">'."\n";
986
+			$html .= '<h1>'.__ ( 'Podcast Settings', 'seriously-simple-podcasting' ).'</h1>'."\n";
987 987
 
988 988
 			$tab = 'general';
989
-			if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {
990
-				$tab = $_GET['tab'];
989
+			if ( isset( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] ) {
990
+				$tab = $_GET[ 'tab' ];
991 991
 			}
992 992
 
993 993
 			// Show page tabs
994
-			if ( is_array( $this->settings ) && 1 < count( $this->settings ) ) {
994
+			if ( is_array ( $this->settings ) && 1 < count ( $this->settings ) ) {
995 995
 
996
-				$html .= '<h2 class="nav-tab-wrapper">' . "\n";
996
+				$html .= '<h2 class="nav-tab-wrapper">'."\n";
997 997
 
998 998
 				$c = 0;
999 999
 				foreach ( $this->settings as $section => $data ) {
1000 1000
 
1001 1001
 					// Set tab class
1002 1002
 					$class = 'nav-tab';
1003
-					if ( ! isset( $_GET['tab'] ) ) {
1003
+					if ( ! isset( $_GET[ 'tab' ] ) ) {
1004 1004
 						if ( 0 == $c ) {
1005 1005
 							$class .= ' nav-tab-active';
1006 1006
 						}
1007 1007
 					} else {
1008
-						if ( isset( $_GET['tab'] ) && $section == $_GET['tab'] ) {
1008
+						if ( isset( $_GET[ 'tab' ] ) && $section == $_GET[ 'tab' ] ) {
1009 1009
 							$class .= ' nav-tab-active';
1010 1010
 						}
1011 1011
 					}
1012 1012
 
1013 1013
 					// Set tab link
1014
-					$tab_link = add_query_arg( array( 'tab' => $section ) );
1015
-					if ( isset( $_GET['settings-updated'] ) ) {
1016
-						$tab_link = remove_query_arg( 'settings-updated', $tab_link );
1014
+					$tab_link = add_query_arg ( array( 'tab' => $section ) );
1015
+					if ( isset( $_GET[ 'settings-updated' ] ) ) {
1016
+						$tab_link = remove_query_arg ( 'settings-updated', $tab_link );
1017 1017
 					}
1018 1018
 
1019
-					if ( isset( $_GET['feed-series'] ) ) {
1020
-						$tab_link = remove_query_arg( 'feed-series', $tab_link );
1019
+					if ( isset( $_GET[ 'feed-series' ] ) ) {
1020
+						$tab_link = remove_query_arg ( 'feed-series', $tab_link );
1021 1021
 					}
1022 1022
 
1023 1023
 					// Output tab
1024
-					$html .= '<a href="' . esc_url( $tab_link ) . '" class="' . esc_attr( $class ) . '">' . esc_html( $data['title'] ) . '</a>' . "\n";
1024
+					$html .= '<a href="'.esc_url ( $tab_link ).'" class="'.esc_attr ( $class ).'">'.esc_html ( $data[ 'title' ] ).'</a>'."\n";
1025 1025
 
1026 1026
 					++$c;
1027 1027
 				}
1028 1028
 
1029
-				$html .= '</h2>' . "\n";
1029
+				$html .= '</h2>'."\n";
1030 1030
 			}
1031 1031
 
1032
-			if ( isset( $_GET['settings-updated'] ) ) {
1032
+			if ( isset( $_GET[ 'settings-updated' ] ) ) {
1033 1033
 				$html .= '<br/><div class="updated notice notice-success is-dismissible">
1034
-					        <p>' . sprintf( __( '%1$s settings updated.', 'seriously-simple-podcasting' ), '<b>' . str_replace( '-', ' ', ucfirst( $tab ) ) . '</b>' ) . '</p>
1034
+					        <p>' . sprintf ( __ ( '%1$s settings updated.', 'seriously-simple-podcasting' ), '<b>'.str_replace ( '-', ' ', ucfirst ( $tab ) ).'</b>' ).'</p>
1035 1035
 					    </div>';
1036 1036
 			}
1037 1037
 
1038
-			if( function_exists( 'php_sapi_name') && 'security' == $tab ) {
1039
-				$sapi_type = php_sapi_name();
1040
-				if ( strpos( $sapi_type, 'fcgi' ) !== false ) {
1038
+			if ( function_exists ( 'php_sapi_name' ) && 'security' == $tab ) {
1039
+				$sapi_type = php_sapi_name ();
1040
+				if ( strpos ( $sapi_type, 'fcgi' ) !== false ) {
1041 1041
 				    $html .= '<br/><div class="update-nag">
1042
-					        <p>' . sprintf( __( 'It looks like your server has FastCGI enabled, which will prevent the feed password protection feature from working. You can fix this by following %1$sthis quick guide%2$s.', 'seriously-simple-podcasting' ), '<a href="http://www.seriouslysimplepodcasting.com/documentation/why-does-the-feed-password-protection-feature-not-work/" target="_blank">', '</a>' ) . '</p>
1042
+					        <p>' . sprintf ( __ ( 'It looks like your server has FastCGI enabled, which will prevent the feed password protection feature from working. You can fix this by following %1$sthis quick guide%2$s.', 'seriously-simple-podcasting' ), '<a href="http://www.seriouslysimplepodcasting.com/documentation/why-does-the-feed-password-protection-feature-not-work/" target="_blank">', '</a>' ).'</p>
1043 1043
 					    </div>';
1044 1044
 				}
1045 1045
 			}
@@ -1048,23 +1048,23 @@  discard block
 block discarded – undo
1048 1048
 
1049 1049
 			// Series submenu for feed details
1050 1050
 			if ( 'feed-details' == $tab ) {
1051
-				$series = get_terms( 'series', array( 'hide_empty' => false ) );
1051
+				$series = get_terms ( 'series', array( 'hide_empty' => false ) );
1052 1052
 
1053 1053
 				if ( ! empty( $series ) ) {
1054 1054
 
1055
-					if ( isset( $_GET['feed-series'] ) && $_GET['feed-series'] && 'default' != $_GET['feed-series'] ) {
1056
-						$current_series = esc_attr( $_GET['feed-series'] );
1055
+					if ( isset( $_GET[ 'feed-series' ] ) && $_GET[ 'feed-series' ] && 'default' != $_GET[ 'feed-series' ] ) {
1056
+						$current_series = esc_attr ( $_GET[ 'feed-series' ] );
1057 1057
 						$series_class = '';
1058 1058
 					} else {
1059 1059
 						$current_series = 'default';
1060 1060
 						$series_class = 'current';
1061 1061
 					}
1062 1062
 
1063
-					$html .= '<div class="feed-series-list-container">' . "\n";
1064
-						$html .= '<span id="feed-series-toggle" class="series-open" title="' . __( 'Toggle series list display', 'seriously-simple-podcasting' ) . '"></span>' . "\n";
1063
+					$html .= '<div class="feed-series-list-container">'."\n";
1064
+						$html .= '<span id="feed-series-toggle" class="series-open" title="'.__ ( 'Toggle series list display', 'seriously-simple-podcasting' ).'"></span>'."\n";
1065 1065
 
1066
-						$html .= '<ul id="feed-series-list" class="subsubsub series-open">' . "\n";
1067
-							$html .= '<li><a href="' . add_query_arg( array( 'feed-series' => 'default', 'settings-updated' => false ) ) . '" class="' . $series_class . '">' . __( 'Default feed', 'seriously-simple-podcasting' ) . '</a></li>';
1066
+						$html .= '<ul id="feed-series-list" class="subsubsub series-open">'."\n";
1067
+							$html .= '<li><a href="'.add_query_arg ( array( 'feed-series' => 'default', 'settings-updated' => false ) ).'" class="'.$series_class.'">'.__ ( 'Default feed', 'seriously-simple-podcasting' ).'</a></li>';
1068 1068
 
1069 1069
 							foreach ( $series as $s ) {
1070 1070
 
@@ -1074,39 +1074,39 @@  discard block
 block discarded – undo
1074 1074
 									$series_class = '';
1075 1075
 								}
1076 1076
 
1077
-								$html .= '<li>' . "\n";
1078
-									$html .= ' | <a href="' . esc_url( add_query_arg( array( 'feed-series' => $s->slug, 'settings-updated' => false ) ) ) . '" class="' . $series_class . '">' . $s->name . '</a>' . "\n";
1079
-								$html .= '</li>' . "\n";
1077
+								$html .= '<li>'."\n";
1078
+									$html .= ' | <a href="'.esc_url ( add_query_arg ( array( 'feed-series' => $s->slug, 'settings-updated' => false ) ) ).'" class="'.$series_class.'">'.$s->name.'</a>'."\n";
1079
+								$html .= '</li>'."\n";
1080 1080
 							}
1081 1081
 
1082
-						$html .= '</ul>' . "\n";
1083
-						$html .= '<br class="clear" />' . "\n";
1084
-					$html .= '</div>' . "\n";
1082
+						$html .= '</ul>'."\n";
1083
+						$html .= '<br class="clear" />'."\n";
1084
+					$html .= '</div>'."\n";
1085 1085
 
1086 1086
 				}
1087 1087
 			}
1088 1088
 
1089
-			$html .= '<form method="post" action="options.php" enctype="multipart/form-data">' . "\n";
1089
+			$html .= '<form method="post" action="options.php" enctype="multipart/form-data">'."\n";
1090 1090
 
1091 1091
 				// Add current series to posted data
1092 1092
 				if ( $current_series ) {
1093
-					$html .= '<input type="hidden" name="feed-series" value="' . esc_attr( $current_series ) . '" />' . "\n";
1093
+					$html .= '<input type="hidden" name="feed-series" value="'.esc_attr ( $current_series ).'" />'."\n";
1094 1094
 				}
1095 1095
 
1096 1096
 				// Get settings fields
1097
-				ob_start();
1098
-				settings_fields( 'ss_podcasting' );
1099
-				do_settings_sections( 'ss_podcasting' );
1100
-				$html .= ob_get_clean();
1097
+				ob_start ();
1098
+				settings_fields ( 'ss_podcasting' );
1099
+				do_settings_sections ( 'ss_podcasting' );
1100
+				$html .= ob_get_clean ();
1101 1101
 
1102 1102
 				// Submit button
1103
-				$html .= '<p class="submit">' . "\n";
1104
-					$html .= '<input type="hidden" name="tab" value="' . esc_attr( $tab ) . '" />' . "\n";
1105
-					$html .= '<input name="Submit" type="submit" class="button-primary" value="' . esc_attr( __( 'Save Settings' , 'seriously-simple-podcasting' ) ) . '" />' . "\n";
1106
-				$html .= '</p>' . "\n";
1103
+				$html .= '<p class="submit">'."\n";
1104
+					$html .= '<input type="hidden" name="tab" value="'.esc_attr ( $tab ).'" />'."\n";
1105
+					$html .= '<input name="Submit" type="submit" class="button-primary" value="'.esc_attr ( __ ( 'Save Settings', 'seriously-simple-podcasting' ) ).'" />'."\n";
1106
+				$html .= '</p>'."\n";
1107 1107
 
1108
-			$html .= '</form>' . "\n";
1109
-		$html .= '</div>' . "\n";
1108
+			$html .= '</form>'."\n";
1109
+		$html .= '</div>'."\n";
1110 1110
 
1111 1111
 	  	echo $html;
1112 1112
 	}
Please login to merge, or discard this patch.
includes/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   +303 added lines, -303 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,39 +155,39 @@  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
-		$player_visibility = get_option( 'ss_podcasting_player_content_visibility', 'all' );
173
+		$player_visibility = get_option ( 'ss_podcasting_player_content_visibility', 'all' );
174 174
 
175
-		switch( $player_visibility ) {
175
+		switch ( $player_visibility ) {
176 176
 			case 'all': $show_player = true; break;
177
-			case 'membersonly': $show_player = is_user_logged_in(); break;
177
+			case 'membersonly': $show_player = is_user_logged_in (); break;
178 178
 		}
179 179
 
180
-		if ( $show_player && in_array( $post->post_type, $podcast_post_types ) && ! is_feed() && ! isset( $_GET['feed'] ) ) {
180
+		if ( $show_player && in_array ( $post->post_type, $podcast_post_types ) && ! is_feed () && ! isset( $_GET[ 'feed' ] ) ) {
181 181
 
182 182
 			// Get episode meta data
183
-			$meta = $this->episode_meta( $post->ID, 'content' );
183
+			$meta = $this->episode_meta ( $post->ID, 'content' );
184 184
 
185 185
 			// Get specified player position
186
-			$player_position = get_option( 'ss_podcasting_player_content_location', 'above' );
186
+			$player_position = get_option ( 'ss_podcasting_player_content_location', 'above' );
187 187
 
188
-			switch( $player_position ) {
189
-				case 'above': $content = $meta . $content; break;
190
-				case 'below': $content = $content . $meta; break;
188
+			switch ( $player_position ) {
189
+				case 'above': $content = $meta.$content; break;
190
+				case 'below': $content = $content.$meta; break;
191 191
 			}
192 192
 
193 193
 		}
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 * @return string          Modified excerpt
202 202
 	 */
203 203
 	public function get_excerpt_meta_data( $excerpt = '' ) {
204
-		return $this->excerpt_meta_data( $excerpt, 'excerpt' );
204
+		return $this->excerpt_meta_data ( $excerpt, 'excerpt' );
205 205
 	}
206 206
 
207 207
 	/**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	 * @return string          Modified excerpt
211 211
 	 */
212 212
 	public function get_embed_meta_data( $excerpt = '' ) {
213
-		return $this->excerpt_meta_data( $excerpt, 'embed' );
213
+		return $this->excerpt_meta_data ( $excerpt, 'embed' );
214 214
 	}
215 215
 
216 216
 	/**
@@ -221,24 +221,24 @@  discard block
 block discarded – undo
221 221
 	public function excerpt_meta_data( $excerpt = '', $content = 'excerpt' ) {
222 222
 		global $post;
223 223
 
224
-		if( post_password_required( $post->ID ) ) {
224
+		if ( post_password_required ( $post->ID ) ) {
225 225
 			return $excerpt;
226 226
 		}
227 227
 
228
-		$podcast_post_types = ssp_post_types( true );
228
+		$podcast_post_types = ssp_post_types ( true );
229 229
 
230
-		$player_visibility = get_option( 'ss_podcasting_player_content_visibility', 'all' );
230
+		$player_visibility = get_option ( 'ss_podcasting_player_content_visibility', 'all' );
231 231
 
232
-		switch( $player_visibility ) {
232
+		switch ( $player_visibility ) {
233 233
 			case 'all': $show_player = true; break;
234
-			case 'membersonly': $show_player = is_user_logged_in(); break;
234
+			case 'membersonly': $show_player = is_user_logged_in (); break;
235 235
 		}
236 236
 
237
-		if ( $show_player && in_array( $post->post_type, $podcast_post_types ) && ! is_feed() && ! isset( $_GET['feed'] ) ) {
237
+		if ( $show_player && in_array ( $post->post_type, $podcast_post_types ) && ! is_feed () && ! isset( $_GET[ 'feed' ] ) ) {
238 238
 
239
-			$meta = $this->episode_meta( $post->ID, $content );
239
+			$meta = $this->episode_meta ( $post->ID, $content );
240 240
 
241
-			$excerpt = $meta . $excerpt;
241
+			$excerpt = $meta.$excerpt;
242 242
 
243 243
 		}
244 244
 
@@ -259,34 +259,34 @@  discard block
 block discarded – undo
259 259
 			return $meta;
260 260
 		}
261 261
 
262
-		$file = $this->get_enclosure( $episode_id );
262
+		$file = $this->get_enclosure ( $episode_id );
263 263
 
264 264
 		if ( $file ) {
265 265
 
266
-			if ( get_option( 'permalink_structure' ) ) {
267
-				$file = $this->get_episode_download_link( $episode_id );
266
+			if ( get_option ( 'permalink_structure' ) ) {
267
+				$file = $this->get_episode_download_link ( $episode_id );
268 268
 			}
269 269
 
270 270
 			// Hide audio player in `ss_podcast` shortcode by default
271 271
 			$show_player = true;
272
-			if( 'shortcode' == $context ) {
272
+			if ( 'shortcode' == $context ) {
273 273
 				$show_player = false;
274 274
 			}
275 275
 
276 276
 			// Allow media player to be dynamically hidden/displayed
277
-			$show_player = apply_filters( 'ssp_show_media_player', $show_player, $context );
277
+			$show_player = apply_filters ( 'ssp_show_media_player', $show_player, $context );
278 278
 
279 279
 			// Show audio player if requested
280
-			if( $show_player ) {
281
-				$meta .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>';
280
+			if ( $show_player ) {
281
+				$meta .= '<div class="podcast_player">'.$this->media_player ( $file, $episode_id ).'</div>';
282 282
 			}
283 283
 
284
-			if ( apply_filters( 'ssp_show_episode_details', true, $episode_id, $context ) ) {
285
-				$meta .= $this->episode_meta_details( $episode_id, $context );
284
+			if ( apply_filters ( 'ssp_show_episode_details', true, $episode_id, $context ) ) {
285
+				$meta .= $this->episode_meta_details ( $episode_id, $context );
286 286
 			}
287 287
 		}
288 288
 
289
-		$meta = apply_filters( 'ssp_episode_meta', $meta, $episode_id, $context );
289
+		$meta = apply_filters ( 'ssp_episode_meta', $meta, $episode_id, $context );
290 290
 
291 291
 		return $meta;
292 292
 	}
@@ -297,36 +297,36 @@  discard block
 block discarded – undo
297 297
 	 * @param  string  $context    Context for display
298 298
 	 * @return string              Episode meta details
299 299
 	 */
300
-	public function episode_meta_details ( $episode_id = 0, $context = 'content' ) {
300
+	public function episode_meta_details( $episode_id = 0, $context = 'content' ) {
301 301
 
302 302
 		if ( ! $episode_id ) {
303 303
 			return;
304 304
 		}
305 305
 
306
-		$file = $this->get_enclosure( $episode_id );
306
+		$file = $this->get_enclosure ( $episode_id );
307 307
 
308 308
 		if ( ! $file ) {
309 309
 			return;
310 310
 		}
311 311
 
312
-		$link = $this->get_episode_download_link( $episode_id, 'download' );
313
-		$duration = get_post_meta( $episode_id , 'duration' , true );
314
-		$size = get_post_meta( $episode_id , 'filesize' , true );
312
+		$link = $this->get_episode_download_link ( $episode_id, 'download' );
313
+		$duration = get_post_meta ( $episode_id, 'duration', true );
314
+		$size = get_post_meta ( $episode_id, 'filesize', true );
315 315
 		if ( ! $size ) {
316
-			$size_data = $this->get_file_size( $file );
317
-			$size = $size_data['formatted'];
316
+			$size_data = $this->get_file_size ( $file );
317
+			$size = $size_data[ 'formatted' ];
318 318
 			if ( $size ) {
319
-				if ( isset( $size_data['formatted'] ) ) {
320
-					update_post_meta( $episode_id, 'filesize', $size_data['formatted'] );
319
+				if ( isset( $size_data[ 'formatted' ] ) ) {
320
+					update_post_meta ( $episode_id, 'filesize', $size_data[ 'formatted' ] );
321 321
 				}
322 322
 
323
-				if ( isset( $size_data['raw'] ) ) {
324
-					update_post_meta( $episode_id, 'filesize_raw', $size_data['raw'] );
323
+				if ( isset( $size_data[ 'raw' ] ) ) {
324
+					update_post_meta ( $episode_id, 'filesize_raw', $size_data[ 'raw' ] );
325 325
 				}
326 326
 			}
327 327
 		}
328 328
 
329
-		$date_recorded = get_post_meta( $episode_id, 'date_recorded', true );
329
+		$date_recorded = get_post_meta ( $episode_id, 'date_recorded', true );
330 330
 
331 331
 		// Build up meta data array with default values
332 332
 		$meta = array(
@@ -337,62 +337,62 @@  discard block
 block discarded – undo
337 337
 			'date_recorded' => '',
338 338
 		);
339 339
 
340
-		if( $link ) {
341
-			$meta['link'] = $link;
340
+		if ( $link ) {
341
+			$meta[ 'link' ] = $link;
342 342
 		}
343 343
 
344
-		if( $link && apply_filters( 'ssp_show_new_window_link', true, $context ) ) {
345
-			$meta['new_window'] = true;
344
+		if ( $link && apply_filters ( 'ssp_show_new_window_link', true, $context ) ) {
345
+			$meta[ 'new_window' ] = true;
346 346
 		}
347 347
 
348
-		if( $link ) {
349
-			$meta['duration'] = $duration;
348
+		if ( $link ) {
349
+			$meta[ 'duration' ] = $duration;
350 350
 		}
351 351
 
352
-		if( $size ) {
353
-			$meta['size'] = $size;
352
+		if ( $size ) {
353
+			$meta[ 'size' ] = $size;
354 354
 		}
355 355
 
356
-		if( $date_recorded ) {
357
-			$meta['date_recorded'] = $date_recorded;
356
+		if ( $date_recorded ) {
357
+			$meta[ 'date_recorded' ] = $date_recorded;
358 358
 		}
359 359
 
360 360
 		// Allow dynamic filtering of meta data - to remove, add or reorder meta items
361
-		$meta = apply_filters( 'ssp_episode_meta_details', $meta, $episode_id, $context );
361
+		$meta = apply_filters ( 'ssp_episode_meta_details', $meta, $episode_id, $context );
362 362
 
363 363
 		$meta_display = '';
364
-		$meta_sep = apply_filters( 'ssp_episode_meta_separator', ' | ' );
364
+		$meta_sep = apply_filters ( 'ssp_episode_meta_separator', ' | ' );
365 365
 		foreach ( $meta as $key => $data ) {
366 366
 
367
-			if( ! $data ) {
367
+			if ( ! $data ) {
368 368
 				continue;
369 369
 			}
370 370
 
371
-			if( $meta_display ) {
371
+			if ( $meta_display ) {
372 372
 				$meta_display .= $meta_sep;
373 373
 			}
374 374
 
375
-			switch( $key ) {
375
+			switch ( $key ) {
376 376
 
377 377
 				case 'link':
378
-					$meta_display .= '<a href="' . esc_url( $data ) . '" title="' . get_the_title() . ' " class="podcast-meta-download" download>' . __( 'Download file' , 'seriously-simple-podcasting' ) . '</a>';
378
+					$meta_display .= '<a href="'.esc_url ( $data ).'" title="'.get_the_title ().' " class="podcast-meta-download" download>'.__ ( 'Download file', 'seriously-simple-podcasting' ).'</a>';
379 379
 				break;
380 380
 
381 381
 				case 'new_window':
382
-					$play_link = add_query_arg( 'ref', 'new_window', $link );
383
-					$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>';
382
+					$play_link = add_query_arg ( 'ref', 'new_window', $link );
383
+					$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>';
384 384
 				break;
385 385
 
386 386
 				case 'duration':
387
-					$meta_display .= '<span class="podcast-meta-duration">' . __( 'Duration' , 'seriously-simple-podcasting' ) . ': ' . $data . '</span>';
387
+					$meta_display .= '<span class="podcast-meta-duration">'.__ ( 'Duration', 'seriously-simple-podcasting' ).': '.$data.'</span>';
388 388
 				break;
389 389
 
390 390
 				case 'size':
391
-					$meta_display .= '<span class="podcast-meta-size">' . __( 'Size' , 'seriously-simple-podcasting' ) . ': ' . $data . '</span>';
391
+					$meta_display .= '<span class="podcast-meta-size">'.__ ( 'Size', 'seriously-simple-podcasting' ).': '.$data.'</span>';
392 392
 				break;
393 393
 
394 394
 				case 'date_recorded':
395
-					$meta_display .= '<span class="podcast-meta-date">' . __( 'Recorded on' , 'seriously-simple-podcasting' ) . ' ' . date_i18n( get_option( 'date_format' ), strtotime( $data ) ) . '</span>';
395
+					$meta_display .= '<span class="podcast-meta-date">'.__ ( 'Recorded on', 'seriously-simple-podcasting' ).' '.date_i18n ( get_option ( 'date_format' ), strtotime ( $data ) ).'</span>';
396 396
 				break;
397 397
 
398 398
 				// Allow for custom items to be added, but only allow a small amount of HTML tags
@@ -408,13 +408,13 @@  discard block
 block discarded – undo
408 408
 							'target' => array(),
409 409
 						),
410 410
 					);
411
-					$meta_display .= wp_kses( $data, $allowed_tags );
411
+					$meta_display .= wp_kses ( $data, $allowed_tags );
412 412
 				break;
413 413
 
414 414
 			}
415 415
 		}
416 416
 
417
-		$meta_display = '<div class="podcast_meta"><aside>' . $meta_display . '</aside></div>';
417
+		$meta_display = '<div class="podcast_meta"><aside>'.$meta_display.'</aside></div>';
418 418
 
419 419
 		return $meta_display;
420 420
 
@@ -426,43 +426,43 @@  discard block
 block discarded – undo
426 426
 	 */
427 427
 	public function add_to_home_query( $query ) {
428 428
 
429
-		if ( is_admin() ) {
429
+		if ( is_admin () ) {
430 430
 			return;
431 431
 		}
432 432
 
433
-		$include_in_main_query = get_option('ss_podcasting_include_in_main_query');
433
+		$include_in_main_query = get_option ( 'ss_podcasting_include_in_main_query' );
434 434
 		if ( $include_in_main_query && $include_in_main_query == 'on' ) {
435
-			if ( $query->is_home() && $query->is_main_query() ) {
436
-				$query->set( 'post_type', array( 'post', 'podcast' ) );
435
+			if ( $query->is_home () && $query->is_main_query () ) {
436
+				$query->set ( 'post_type', array( 'post', 'podcast' ) );
437 437
 			}
438 438
 		}
439 439
 	}
440 440
 
441
-	public function add_all_post_types ( $query ) {
441
+	public function add_all_post_types( $query ) {
442 442
 
443
-		if ( is_admin() ) {
443
+		if ( is_admin () ) {
444 444
 			return;
445 445
 		}
446 446
 
447
-		if ( ! $query->is_main_query() ) {
447
+		if ( ! $query->is_main_query () ) {
448 448
 			return;
449 449
 		}
450 450
 
451
-		if ( is_post_type_archive( 'podcast' ) || is_tax( 'series' ) ) {
451
+		if ( is_post_type_archive ( 'podcast' ) || is_tax ( 'series' ) ) {
452 452
 
453
-			$podcast_post_types = ssp_post_types( false );
453
+			$podcast_post_types = ssp_post_types ( false );
454 454
 
455 455
 			if ( empty( $podcast_post_types ) ) {
456 456
 				return;
457 457
 			}
458 458
 
459
-			$episode_ids = ssp_episode_ids();
459
+			$episode_ids = ssp_episode_ids ();
460 460
 			if ( ! empty( $episode_ids ) ) {
461 461
 
462
-				$query->set( 'post__in', $episode_ids );
462
+				$query->set ( 'post__in', $episode_ids );
463 463
 
464
-				$podcast_post_types[] = 'podcast';
465
-				$query->set( 'post_type', $podcast_post_types );
464
+				$podcast_post_types[ ] = 'podcast';
465
+				$query->set ( 'post_type', $podcast_post_types );
466 466
 
467 467
 			}
468 468
 
@@ -480,29 +480,29 @@  discard block
 block discarded – undo
480 480
 		if ( $file ) {
481 481
 
482 482
 			// Include media functions if necessary
483
-			if ( ! function_exists( 'wp_read_audio_metadata' ) ) {
484
-				require_once( ABSPATH . 'wp-admin/includes/media.php' );
483
+			if ( ! function_exists ( 'wp_read_audio_metadata' ) ) {
484
+				require_once( ABSPATH.'wp-admin/includes/media.php' );
485 485
 			}
486 486
 
487 487
 			// translate file URL to local file path if possible
488
-			$file = $this->get_local_file_path( $file );
488
+			$file = $this->get_local_file_path ( $file );
489 489
 
490 490
 			// Get file data (for local file)
491
-			$data = wp_read_audio_metadata( $file );
491
+			$data = wp_read_audio_metadata ( $file );
492 492
 
493 493
 			$raw = $formatted = '';
494 494
 
495 495
 			if ( $data ) {
496
-				$raw = $data['filesize'];
497
-				$formatted = $this->format_bytes( $raw );
496
+				$raw = $data[ 'filesize' ];
497
+				$formatted = $this->format_bytes ( $raw );
498 498
 			} else {
499 499
 
500 500
 				// get file data (for remote file)
501
-				$data = wp_remote_head( $file, array( 'timeout' => 10, 'redirection' => 5 ) );
501
+				$data = wp_remote_head ( $file, array( 'timeout' => 10, 'redirection' => 5 ) );
502 502
 
503
-				if ( ! is_wp_error( $data ) && is_array( $data ) && isset( $data['headers']['content-length'] ) ) {
504
-					$raw = $data['headers']['content-length'];
505
-					$formatted = $this->format_bytes( $raw );
503
+				if ( ! is_wp_error ( $data ) && is_array ( $data ) && isset( $data[ 'headers' ][ 'content-length' ] ) ) {
504
+					$raw = $data[ 'headers' ][ 'content-length' ];
505
+					$formatted = $this->format_bytes ( $raw );
506 506
 				}
507 507
 			}
508 508
 
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 					'formatted' => $formatted
514 514
 				);
515 515
 
516
-				return apply_filters( 'ssp_file_size', $size, $file );
516
+				return apply_filters ( 'ssp_file_size', $size, $file );
517 517
 			}
518 518
 
519 519
 		}
@@ -531,30 +531,30 @@  discard block
 block discarded – undo
531 531
 		if ( $file ) {
532 532
 
533 533
 			// Include media functions if necessary
534
-			if ( ! function_exists( 'wp_read_audio_metadata' ) ) {
535
-				require_once( ABSPATH . 'wp-admin/includes/media.php' );
534
+			if ( ! function_exists ( 'wp_read_audio_metadata' ) ) {
535
+				require_once( ABSPATH.'wp-admin/includes/media.php' );
536 536
 			}
537 537
 
538 538
 			// translate file URL to local file path if possible
539
-			$file = $this->get_local_file_path( $file );
539
+			$file = $this->get_local_file_path ( $file );
540 540
 
541 541
 			// Get file data (will only work for local files)
542
-			$data = wp_read_audio_metadata( $file );
542
+			$data = wp_read_audio_metadata ( $file );
543 543
 
544 544
 			$duration = false;
545 545
 
546 546
 			if ( $data ) {
547
-				if ( isset( $data['length_formatted'] ) && strlen( $data['length_formatted'] ) > 0 ) {
548
-					$duration = $data['length_formatted'];
547
+				if ( isset( $data[ 'length_formatted' ] ) && strlen ( $data[ 'length_formatted' ] ) > 0 ) {
548
+					$duration = $data[ 'length_formatted' ];
549 549
 				} else {
550
-					if ( isset( $data['length'] ) && strlen( $data['length'] ) > 0 ) {
551
-						$duration = gmdate( 'H:i:s', $data['length'] );
550
+					if ( isset( $data[ 'length' ] ) && strlen ( $data[ 'length' ] ) > 0 ) {
551
+						$duration = gmdate ( 'H:i:s', $data[ 'length' ] );
552 552
 					}
553 553
 				}
554 554
 			}
555 555
 
556 556
 			if ( $data ) {
557
-				return apply_filters( 'ssp_file_duration', $duration, $file );
557
+				return apply_filters ( 'ssp_file_duration', $duration, $file );
558 558
 			}
559 559
 
560 560
 		}
@@ -568,15 +568,15 @@  discard block
 block discarded – undo
568 568
 	 * @param  integer $precision Level of precision for formatting
569 569
 	 * @return mixed              Formatted file size on success, false on failure
570 570
 	 */
571
-	protected function format_bytes( $size , $precision = 2 ) {
571
+	protected function format_bytes( $size, $precision = 2 ) {
572 572
 
573 573
 		if ( $size ) {
574 574
 
575
-		    $base = log ( $size ) / log( 1024 );
576
-		    $suffixes = array( '' , 'k' , 'M' , 'G' , 'T' );
577
-		    $formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ];
575
+		    $base = log ( $size ) / log ( 1024 );
576
+		    $suffixes = array( '', 'k', 'M', 'G', 'T' );
577
+		    $formatted_size = round ( pow ( 1024, $base - floor ( $base ) ), $precision ).$suffixes[ floor ( $base ) ];
578 578
 
579
-		    return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size );
579
+		    return apply_filters ( 'ssp_file_size_formatted', $formatted_size, $size );
580 580
 		}
581 581
 
582 582
 		return false;
@@ -592,10 +592,10 @@  discard block
 block discarded – undo
592 592
 
593 593
 		// Let's hash the URL to ensure that we don't get
594 594
 		// any illegal chars that might break the cache.
595
-		$key = md5( $url );
595
+		$key = md5 ( $url );
596 596
 
597 597
 		// Do we have anything in the cache for this URL?
598
-		$attachment_id = wp_cache_get( $key, 'attachment_id' );
598
+		$attachment_id = wp_cache_get ( $key, 'attachment_id' );
599 599
 
600 600
 		if ( $attachment_id === false ) {
601 601
 
@@ -612,39 +612,39 @@  discard block
 block discarded – undo
612 612
 
613 613
 
614 614
 			// Function introduced in 4.0, let's try this first.
615
-			if ( function_exists( 'attachment_url_to_postid' ) ) {
616
-				$attachment_id = absint( attachment_url_to_postid( $url ) );
615
+			if ( function_exists ( 'attachment_url_to_postid' ) ) {
616
+				$attachment_id = absint ( attachment_url_to_postid ( $url ) );
617 617
 				if ( 0 !== $attachment_id ) {
618
-					wp_cache_set( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
618
+					wp_cache_set ( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
619 619
 					return $attachment_id;
620 620
 				}
621 621
 			}
622 622
 
623 623
 			// Then this.
624
-			if ( preg_match( '#\.[a-zA-Z0-9]+$#', $url ) ) {
625
-				$sql = $wpdb->prepare(
624
+			if ( preg_match ( '#\.[a-zA-Z0-9]+$#', $url ) ) {
625
+				$sql = $wpdb->prepare (
626 626
 					"SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND guid = %s",
627
-					esc_url_raw( $url )
627
+					esc_url_raw ( $url )
628 628
 				);
629
-				$attachment_id = absint( $wpdb->get_var( $sql ) );
629
+				$attachment_id = absint ( $wpdb->get_var ( $sql ) );
630 630
 				if ( 0 !== $attachment_id ) {
631
-					wp_cache_set( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
631
+					wp_cache_set ( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
632 632
 					return $attachment_id;
633 633
 				}
634 634
 			}
635 635
 
636 636
 			// And then try this
637
-			$upload_dir_paths = wp_upload_dir();
638
-			if ( false !== strpos( $url, $upload_dir_paths['baseurl'] ) ) {
637
+			$upload_dir_paths = wp_upload_dir ();
638
+			if ( false !== strpos ( $url, $upload_dir_paths[ 'baseurl' ] ) ) {
639 639
 				// Ensure that we have file extension that matches iTunes.
640
-				$url = preg_replace( '/(?=\.(m4a|mp3|mov|mp4)$)/i', '', $url );
640
+				$url = preg_replace ( '/(?=\.(m4a|mp3|mov|mp4)$)/i', '', $url );
641 641
 				// Remove the upload path base directory from the attachment URL
642
-				$url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $url );
642
+				$url = str_replace ( $upload_dir_paths[ 'baseurl' ].'/', '', $url );
643 643
 				// Finally, run a custom database query to get the attachment ID from the modified attachment URL
644
-				$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 );
645
-				$attachment_id = absint( $wpdb->get_var( $sql ) );
644
+				$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 );
645
+				$attachment_id = absint ( $wpdb->get_var ( $sql ) );
646 646
 				if ( 0 !== $attachment_id ) {
647
-					wp_cache_set( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
647
+					wp_cache_set ( $key, $attachment_id, 'attachment_id', DAY_IN_SECONDS );
648 648
 					return $attachment_id;
649 649
 				}
650 650
 			}
@@ -662,20 +662,20 @@  discard block
 block discarded – undo
662 662
 	public function get_attachment_mimetype( $attachment = '' ) {
663 663
 
664 664
 		// Let's hash the URL to ensure that we don't get any illegal chars that might break the cache.
665
-		$key = md5( $attachment );
665
+		$key = md5 ( $attachment );
666 666
 
667 667
 		if ( $attachment ) {
668 668
 			// Do we have anything in the cache for this?
669
-			$mime = wp_cache_get( $key, 'mime-type' );
669
+			$mime = wp_cache_get ( $key, 'mime-type' );
670 670
 			if ( $mime === false ) {
671 671
 
672 672
 				// Get the ID
673
-				$id = $this->get_attachment_id_from_url( $attachment );
673
+				$id = $this->get_attachment_id_from_url ( $attachment );
674 674
 
675 675
 				// Get the MIME type
676
-				$mime = get_post_mime_type( $id );
676
+				$mime = get_post_mime_type ( $id );
677 677
 				// Set the cache
678
-				wp_cache_set( $key, $mime, 'mime-type', DAY_IN_SECONDS );
678
+				wp_cache_set ( $key, $mime, 'mime-type', DAY_IN_SECONDS );
679 679
 			}
680 680
 
681 681
 		    return $mime;
@@ -692,8 +692,8 @@  discard block
 block discarded – undo
692 692
 	 * @return string        	   Audio player HTML on success, false on failure
693 693
 	 */
694 694
 	public function audio_player( $src = '', $episode_id = 0 ) {
695
-		$player = $this->media_player( $src, $episode_id );
696
-		return apply_filters( 'ssp_audio_player', $player, $src, $episode_id );
695
+		$player = $this->media_player ( $src, $episode_id );
696
+		return apply_filters ( 'ssp_audio_player', $player, $src, $episode_id );
697 697
 	}
698 698
 
699 699
 	/**
@@ -702,40 +702,40 @@  discard block
 block discarded – undo
702 702
 	 * @param  integer $episode_id Episode ID for audio file
703 703
 	 * @return string              Media player HTML on success, empty string on failure
704 704
 	 */
705
-	public function media_player ( $src = '', $episode_id = 0 ) {
705
+	public function media_player( $src = '', $episode_id = 0 ) {
706 706
 		$player = '';
707 707
 
708 708
 		if ( $src ) {
709 709
 
710 710
 			// Get episode type and default to audio
711
-			$type = $this->get_episode_type( $episode_id );
712
-			if( ! $type ) {
711
+			$type = $this->get_episode_type ( $episode_id );
712
+			if ( ! $type ) {
713 713
 				$type = 'audio';
714 714
 			}
715 715
 
716 716
 			// Switch to podcast player URL
717
-			$src = str_replace( 'podcast-download', 'podcast-player', $src );
717
+			$src = str_replace ( 'podcast-download', 'podcast-player', $src );
718 718
 
719 719
 			// Set up paramters for media player
720 720
 			$params = array( 'src' => $src, 'preload' => 'none' );
721 721
 
722 722
 			// Use built-in WordPress media player
723
-			switch( $type ) {
724
-				case 'audio': $player = wp_audio_shortcode( $params ); break;
723
+			switch ( $type ) {
724
+				case 'audio': $player = wp_audio_shortcode ( $params ); break;
725 725
 				case 'video':
726 726
 					// Use featured image as video poster
727
-					if( $episode_id && has_post_thumbnail( $episode_id ) ) {
728
-						$poster = wp_get_attachment_url( get_post_thumbnail_id( $episode_id ) );
729
-						if( $poster ) {
730
-							$params['poster'] = $poster;
727
+					if ( $episode_id && has_post_thumbnail ( $episode_id ) ) {
728
+						$poster = wp_get_attachment_url ( get_post_thumbnail_id ( $episode_id ) );
729
+						if ( $poster ) {
730
+							$params[ 'poster' ] = $poster;
731 731
 						}
732 732
 					}
733
-					$player = wp_video_shortcode( $params );
733
+					$player = wp_video_shortcode ( $params );
734 734
 				break;
735 735
 			}
736 736
 
737 737
 			// Allow filtering so that alternative players can be used
738
-			$player = apply_filters( 'ssp_media_player', $player, $src, $episode_id );
738
+			$player = apply_filters ( 'ssp_media_player', $player, $src, $episode_id );
739 739
 		}
740 740
 
741 741
 		return $player;
@@ -750,17 +750,17 @@  discard block
 block discarded – undo
750 750
 	public function get_image( $id = 0, $size = 'full' ) {
751 751
 		$image = '';
752 752
 
753
-		if ( has_post_thumbnail( $id ) ) {
753
+		if ( has_post_thumbnail ( $id ) ) {
754 754
 			// If not a string or an array, and not an integer, default to 200x9999.
755
-			if ( is_int( $size ) || ( 0 < intval( $size ) ) ) {
756
-				$size = array( intval( $size ), intval( $size ) );
757
-			} elseif ( ! is_string( $size ) && ! is_array( $size ) ) {
755
+			if ( is_int ( $size ) || ( 0 < intval ( $size ) ) ) {
756
+				$size = array( intval ( $size ), intval ( $size ) );
757
+			} elseif ( ! is_string ( $size ) && ! is_array ( $size ) ) {
758 758
 				$size = array( 200, 9999 );
759 759
 			}
760
-			$image = get_the_post_thumbnail( intval( $id ), $size );
760
+			$image = get_the_post_thumbnail ( intval ( $id ), $size );
761 761
 		}
762 762
 
763
-		return apply_filters( 'ssp_episode_image', $image, $id );
763
+		return apply_filters ( 'ssp_episode_image', $image, $id );
764 764
 	}
765 765
 
766 766
 	/**
@@ -775,29 +775,29 @@  discard block
 block discarded – undo
775 775
 			'series' => ''
776 776
 		);
777 777
 
778
-		$args = apply_filters( 'ssp_get_podcast_args', wp_parse_args( $args, $defaults ) );
778
+		$args = apply_filters ( 'ssp_get_podcast_args', wp_parse_args ( $args, $defaults ) );
779 779
 
780 780
 		$query = array();
781 781
 
782
-		if ( 'episodes' == $args['content'] ) {
782
+		if ( 'episodes' == $args[ 'content' ] ) {
783 783
 
784 784
 			// Get selected series
785 785
 			$podcast_series = '';
786
-			if ( isset( $args['series'] ) && $args['series'] ) {
787
-				$podcast_series = $args['series'];
786
+			if ( isset( $args[ 'series' ] ) && $args[ 'series' ] ) {
787
+				$podcast_series = $args[ 'series' ];
788 788
 			}
789 789
 
790 790
 			// Get query args
791
-			$query_args = apply_filters( 'ssp_get_podcast_query_args', ssp_episodes( -1, $podcast_series, true, '' ) );
791
+			$query_args = apply_filters ( 'ssp_get_podcast_query_args', ssp_episodes ( -1, $podcast_series, true, '' ) );
792 792
 
793 793
 			// The Query
794
-			$query = get_posts( $query_args );
794
+			$query = get_posts ( $query_args );
795 795
 
796 796
 			// The Display
797
-			if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
797
+			if ( ! is_wp_error ( $query ) && is_array ( $query ) && count ( $query ) > 0 ) {
798 798
 				foreach ( $query as $k => $v ) {
799 799
 					// Get the URL
800
-					$query[$k]->url = get_permalink( $v->ID );
800
+					$query[ $k ]->url = get_permalink ( $v->ID );
801 801
 				}
802 802
 			} else {
803 803
 				$query = false;
@@ -805,27 +805,27 @@  discard block
 block discarded – undo
805 805
 
806 806
 		} else {
807 807
 
808
-			$terms = get_terms( 'series' );
808
+			$terms = get_terms ( 'series' );
809 809
 
810
-			if ( count( $terms ) > 0) {
810
+			if ( count ( $terms ) > 0 ) {
811 811
 
812 812
 				foreach ( $terms as $term ) {
813
-					$query[ $term->term_id ] = new stdClass();
813
+					$query[ $term->term_id ] = new stdClass ();
814 814
 					$query[ $term->term_id ]->title = $term->name;
815
-		    		$query[ $term->term_id ]->url = get_term_link( $term );
815
+		    		$query[ $term->term_id ]->url = get_term_link ( $term );
816 816
 
817
-		    		$query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) );
817
+		    		$query_args = apply_filters ( 'ssp_get_podcast_series_query_args', ssp_episodes ( -1, $term->slug, true, '' ) );
818 818
 
819
-		    		$posts = get_posts( $query_args );
819
+		    		$posts = get_posts ( $query_args );
820 820
 
821
-		    		$count = count( $posts );
821
+		    		$count = count ( $posts );
822 822
 		    		$query[ $term->term_id ]->count = $count;
823 823
 			    }
824 824
 			}
825 825
 
826 826
 		}
827 827
 
828
-		$query['content'] = $args['content'];
828
+		$query[ 'content' ] = $args[ 'content' ];
829 829
 
830 830
 		return $query;
831 831
 	}
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 	public function get_enclosure( $episode_id = 0 ) {
839 839
 
840 840
 		if ( $episode_id ) {
841
-			return apply_filters( 'ssp_episode_enclosure', get_post_meta( $episode_id, 'audio_file', true ), $episode_id );
841
+			return apply_filters ( 'ssp_episode_enclosure', get_post_meta ( $episode_id, 'audio_file', true ), $episode_id );
842 842
 		}
843 843
 
844 844
 		return '';
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 
857 857
 		if ( $file != '' ) {
858 858
 
859
-			$post_types = ssp_post_types( true );
859
+			$post_types = ssp_post_types ( true );
860 860
 
861 861
 			$args = array(
862 862
 				'post_type' => $post_types,
@@ -866,17 +866,17 @@  discard block
 block discarded – undo
866 866
 				'meta_value' => $file
867 867
 			);
868 868
 
869
-			$qry = new WP_Query( $args );
869
+			$qry = new WP_Query ( $args );
870 870
 
871
-			if ( $qry->have_posts() ) {
872
-				while ( $qry->have_posts() ) { $qry->the_post();
871
+			if ( $qry->have_posts () ) {
872
+				while ( $qry->have_posts () ) { $qry->the_post ();
873 873
 					$episode = $post;
874 874
 					break;
875 875
 				}
876 876
 			}
877 877
 		}
878 878
 
879
-		return apply_filters( 'ssp_episode_from_file', $episode, $file );
879
+		return apply_filters ( 'ssp_episode_from_file', $episode, $file );
880 880
 
881 881
 	}
882 882
 
@@ -886,33 +886,33 @@  discard block
 block discarded – undo
886 886
 	 */
887 887
 	public function download_file() {
888 888
 
889
-		if ( is_podcast_download() ) {
889
+		if ( is_podcast_download () ) {
890 890
 			global $wp_query;
891 891
 
892 892
 			// Get requested episode ID
893
-			$episode_id = intval( $wp_query->query_vars['podcast_episode'] );
893
+			$episode_id = intval ( $wp_query->query_vars[ 'podcast_episode' ] );
894 894
 
895 895
 			if ( isset( $episode_id ) && $episode_id ) {
896 896
 
897 897
 				// Get episode post object
898
-				$episode = get_post( $episode_id );
898
+				$episode = get_post ( $episode_id );
899 899
 
900 900
 				// Make sure we have a valid episode post object
901
-				if ( ! $episode || ! is_object( $episode ) || is_wp_error( $episode ) || ! isset( $episode->ID ) ) {
901
+				if ( ! $episode || ! is_object ( $episode ) || is_wp_error ( $episode ) || ! isset( $episode->ID ) ) {
902 902
 					return;
903 903
 				}
904 904
 
905 905
 				// Do we have newlines?
906 906
 				$parts = false;
907
-				if( is_string( $episode ) ) {
908
-					$parts = explode( "\n", $episode );
907
+				if ( is_string ( $episode ) ) {
908
+					$parts = explode ( "\n", $episode );
909 909
 				}
910 910
 
911
-				if ( $parts && is_array( $parts ) && count( $parts ) > 1 ) {
912
-					$file = $parts[0];
911
+				if ( $parts && is_array ( $parts ) && count ( $parts ) > 1 ) {
912
+					$file = $parts[ 0 ];
913 913
 				} else {
914 914
 					// Get audio file for download
915
-					$file = $this->get_enclosure( $episode_id );
915
+					$file = $this->get_enclosure ( $episode_id );
916 916
 				}
917 917
 
918 918
 				// Exit if no file is found
@@ -922,77 +922,77 @@  discard block
 block discarded – undo
922 922
 
923 923
 				// Get file referrer
924 924
 				$referrer = '';
925
-				if( isset( $wp_query->query_vars['podcast_ref'] ) && $wp_query->query_vars['podcast_ref'] ) {
926
-					$referrer = $wp_query->query_vars['podcast_ref'];
925
+				if ( isset( $wp_query->query_vars[ 'podcast_ref' ] ) && $wp_query->query_vars[ 'podcast_ref' ] ) {
926
+					$referrer = $wp_query->query_vars[ 'podcast_ref' ];
927 927
 				} else {
928
-					if( isset( $_GET['ref'] ) ) {
929
-						$referrer = esc_attr( $_GET['ref'] );
928
+					if ( isset( $_GET[ 'ref' ] ) ) {
929
+						$referrer = esc_attr ( $_GET[ 'ref' ] );
930 930
 					}
931 931
 				}
932 932
 
933 933
 				// Allow other actions - functions hooked on here must not output any data
934
-			    do_action( 'ssp_file_download', $file, $episode, $referrer );
934
+			    do_action ( 'ssp_file_download', $file, $episode, $referrer );
935 935
 
936 936
 			    // Set necessary headers
937
-				header( "Pragma: no-cache" );
938
-				header( "Expires: 0" );
939
-				header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
940
-				header( "Robots: none" );
937
+				header ( "Pragma: no-cache" );
938
+				header ( "Expires: 0" );
939
+				header ( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
940
+				header ( "Robots: none" );
941 941
 
942 942
 		        // Check file referrer
943
-		        if( 'download' == $referrer ) {
943
+		        if ( 'download' == $referrer ) {
944 944
 
945 945
 		        	// Set size of file
946 946
 					// Do we have anything in Cache/DB?
947
-					$size = wp_cache_get( $episode_id, 'filesize_raw' );
947
+					$size = wp_cache_get ( $episode_id, 'filesize_raw' );
948 948
 
949 949
 					// Nothing in the cache, let's see if we can figure it out.
950 950
 					if ( false === $size ) {
951 951
 
952 952
 						// Do we have anything in post_meta?
953
-						$size = get_post_meta( $episode_id, 'filesize_raw', true );
953
+						$size = get_post_meta ( $episode_id, 'filesize_raw', true );
954 954
 
955 955
 						if ( empty( $size ) ) {
956 956
 
957 957
 							// Let's see if we can figure out the path...
958
-							$attachment_id = $this->get_attachment_id_from_url( $file );
958
+							$attachment_id = $this->get_attachment_id_from_url ( $file );
959 959
 
960
-							if ( ! empty( $attachment_id )  ) {
961
-								$size = filesize( get_attached_file( $attachment_id ) );
962
-								update_post_meta( $episode_id, 'filesize_raw', $size );
960
+							if ( ! empty( $attachment_id ) ) {
961
+								$size = filesize ( get_attached_file ( $attachment_id ) );
962
+								update_post_meta ( $episode_id, 'filesize_raw', $size );
963 963
 							}
964 964
 
965 965
 						}
966 966
 
967 967
 						// Update the cache
968
-						wp_cache_set( $episode_id, $size, 'filesize_raw' );
968
+						wp_cache_set ( $episode_id, $size, 'filesize_raw' );
969 969
 					}
970 970
 
971 971
 					// Send Content-Length header
972 972
 		        	if ( ! empty( $size ) ) {
973
-						header( "Content-Length: " . $size );
973
+						header ( "Content-Length: ".$size );
974 974
 					}
975 975
 
976 976
 		        	// Force file download
977
-		        	header( "Content-Type: application/force-download" );
977
+		        	header ( "Content-Type: application/force-download" );
978 978
 
979 979
 			        // Set other relevant headers
980
-			        header( "Content-Description: File Transfer" );
981
-			        header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" );
982
-			        header( "Content-Transfer-Encoding: binary" );
980
+			        header ( "Content-Description: File Transfer" );
981
+			        header ( "Content-Disposition: attachment; filename=\"".basename ( $file )."\";" );
982
+			        header ( "Content-Transfer-Encoding: binary" );
983 983
 
984 984
 			        // Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
985
-					$file = str_replace( ' ', '%20', $file );
985
+					$file = str_replace ( ' ', '%20', $file );
986 986
 
987 987
 			        // Use ssp_readfile_chunked() if allowed on the server or simply access file directly
988
-					@ssp_readfile_chunked( $file ) or header( 'Location: ' . $file );
988
+					@ssp_readfile_chunked ( $file ) or header ( 'Location: '.$file );
989 989
 				} else {
990 990
 
991 991
 					// Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
992
-					$file = str_replace( ' ', '%20', $file );
992
+					$file = str_replace ( ' ', '%20', $file );
993 993
 
994 994
 					// For all other referrers redirect to the raw file
995
-					wp_redirect( $file, 302 );
995
+					wp_redirect ( $file, 302 );
996 996
 				}
997 997
 
998 998
 				// Exit to prevent other processes running later on
@@ -1009,16 +1009,16 @@  discard block
 block discarded – undo
1009 1009
 	public function generator_tag( $gen, $type ) {
1010 1010
 
1011 1011
 		// Allow generator tags to be hidden if necessary
1012
-		if ( apply_filters( 'ssp_show_generator_tag', true, $type ) ) {
1012
+		if ( apply_filters ( 'ssp_show_generator_tag', true, $type ) ) {
1013 1013
 
1014
-			$generator = 'Seriously Simple Podcasting ' . esc_attr( $this->version );
1014
+			$generator = 'Seriously Simple Podcasting '.esc_attr ( $this->version );
1015 1015
 
1016 1016
 			switch ( $type ) {
1017 1017
 				case 'html':
1018
-					$gen .= "\n" . '<meta name="generator" content="' . $generator . '">';
1018
+					$gen .= "\n".'<meta name="generator" content="'.$generator.'">';
1019 1019
 				break;
1020 1020
 				case 'xhtml':
1021
-					$gen .= "\n" . '<meta name="generator" content="' . $generator . '" />';
1021
+					$gen .= "\n".'<meta name="generator" content="'.$generator.'" />';
1022 1022
 				break;
1023 1023
 			}
1024 1024
 
@@ -1034,53 +1034,53 @@  discard block
 block discarded – undo
1034 1034
 	public function rss_meta_tag() {
1035 1035
 
1036 1036
 		// Get feed slug
1037
-		$feed_slug = apply_filters( 'ssp_feed_slug', $this->token );
1037
+		$feed_slug = apply_filters ( 'ssp_feed_slug', $this->token );
1038 1038
 
1039
-		if ( get_option( 'permalink_structure' ) ) {
1040
-			$feed_url = $this->home_url . 'feed/' . $feed_slug;
1039
+		if ( get_option ( 'permalink_structure' ) ) {
1040
+			$feed_url = $this->home_url.'feed/'.$feed_slug;
1041 1041
 		} else {
1042
-			$feed_url = $this->home_url . '?feed=' . $feed_slug;
1042
+			$feed_url = $this->home_url.'?feed='.$feed_slug;
1043 1043
 		}
1044 1044
 
1045
-		$custom_feed_url = get_option( 'ss_podcasting_feed_url' );
1045
+		$custom_feed_url = get_option ( 'ss_podcasting_feed_url' );
1046 1046
 		if ( $custom_feed_url ) {
1047 1047
 			$feed_url = $custom_feed_url;
1048 1048
 		}
1049 1049
 
1050
-		$feed_url = apply_filters( 'ssp_feed_url', $feed_url );
1050
+		$feed_url = apply_filters ( 'ssp_feed_url', $feed_url );
1051 1051
 
1052 1052
 		$html = '';
1053 1053
 
1054
-		if( apply_filters( 'ssp_show_global_feed_tag', true ) ) {
1055
-			$html = '<link rel="alternate" type="application/rss+xml" title="' . __( 'Podcast RSS feed', 'seriously-simple-podcasting' ) . '" href="' . esc_url( $feed_url ) . '" />';
1054
+		if ( apply_filters ( 'ssp_show_global_feed_tag', true ) ) {
1055
+			$html = '<link rel="alternate" type="application/rss+xml" title="'.__ ( 'Podcast RSS feed', 'seriously-simple-podcasting' ).'" href="'.esc_url ( $feed_url ).'" />';
1056 1056
 		}
1057 1057
 
1058 1058
 		// Check if this is a series taxonomy archive and display series-specific RSS feed tag
1059
-		$current_obj = get_queried_object();
1060
-		if( isset( $current_obj->taxonomy ) && 'series' == $current_obj->taxonomy && isset( $current_obj->slug ) && $current_obj->slug ) {
1059
+		$current_obj = get_queried_object ();
1060
+		if ( isset( $current_obj->taxonomy ) && 'series' == $current_obj->taxonomy && isset( $current_obj->slug ) && $current_obj->slug ) {
1061 1061
 
1062
-			if( apply_filters( 'ssp_show_series_feed_tag', true, $current_obj->slug ) ) {
1062
+			if ( apply_filters ( 'ssp_show_series_feed_tag', true, $current_obj->slug ) ) {
1063 1063
 
1064
-				if ( get_option( 'permalink_structure' ) ) {
1065
-					$series_feed_url = $feed_url . '/' . $current_obj->slug;
1064
+				if ( get_option ( 'permalink_structure' ) ) {
1065
+					$series_feed_url = $feed_url.'/'.$current_obj->slug;
1066 1066
 				} else {
1067
-					$series_feed_url = $feed_url . '&podcast_series=' . $current_obj->slug;
1067
+					$series_feed_url = $feed_url.'&podcast_series='.$current_obj->slug;
1068 1068
 				}
1069 1069
 
1070
-				$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 ) . '" />';
1070
+				$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 ).'" />';
1071 1071
 
1072 1072
 			}
1073 1073
 
1074 1074
 		}
1075 1075
 
1076
-		echo "\n" . apply_filters( 'ssp_rss_meta_tag', $html ) . "\n\n";
1076
+		echo "\n".apply_filters ( 'ssp_rss_meta_tag', $html )."\n\n";
1077 1077
 	}
1078 1078
 
1079 1079
 	/**
1080 1080
 	 * Register plugin widgets
1081 1081
 	 * @return void
1082 1082
 	 */
1083
-	public function register_widgets () {
1083
+	public function register_widgets() {
1084 1084
 
1085 1085
 		$widgets = array(
1086 1086
 			'recent-episodes' => 'Recent_Episodes',
@@ -1090,8 +1090,8 @@  discard block
 block discarded – undo
1090 1090
 		);
1091 1091
 
1092 1092
 		foreach ( $widgets as $id => $name ) {
1093
-			require_once( $this->dir . '/includes/widgets/class-ssp-widget-' . $id . '.php' );
1094
-			register_widget( 'SSP_Widget_' . $name );
1093
+			require_once( $this->dir.'/includes/widgets/class-ssp-widget-'.$id.'.php' );
1094
+			register_widget ( 'SSP_Widget_'.$name );
1095 1095
 		}
1096 1096
 
1097 1097
 	}
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 	 * Register plugin shortcodes
1101 1101
 	 * @return void
1102 1102
 	 */
1103
-	public function register_shortcodes () {
1103
+	public function register_shortcodes() {
1104 1104
 
1105 1105
 		$shortcodes = array(
1106 1106
 			'podcast_episode',
@@ -1109,8 +1109,8 @@  discard block
 block discarded – undo
1109 1109
 		);
1110 1110
 
1111 1111
 		foreach ( $shortcodes as $shortcode ) {
1112
-			require_once( $this->dir . '/includes/shortcodes/class-ssp-shortcode-' . $shortcode . '.php' );
1113
-			add_shortcode( $shortcode, array( $GLOBALS['ssp_shortcodes'][ $shortcode ], 'shortcode' ) );
1112
+			require_once( $this->dir.'/includes/shortcodes/class-ssp-shortcode-'.$shortcode.'.php' );
1113
+			add_shortcode ( $shortcode, array( $GLOBALS[ 'ssp_shortcodes' ][ $shortcode ], 'shortcode' ) );
1114 1114
 		}
1115 1115
 
1116 1116
 	}
@@ -1121,64 +1121,64 @@  discard block
 block discarded – undo
1121 1121
 	 * @param  array   $content_items Orderd array of content items to display
1122 1122
 	 * @return string                 HTML of episode with specified content items
1123 1123
 	 */
1124
-	public function podcast_episode ( $episode_id = 0, $content_items = array( 'title', 'player', 'details' ), $context = '' ) {
1124
+	public function podcast_episode( $episode_id = 0, $content_items = array( 'title', 'player', 'details' ), $context = '' ) {
1125 1125
 		global $post, $episode_context;
1126 1126
 
1127
-		if ( ! $episode_id || ! is_array( $content_items ) || empty( $content_items ) ) {
1127
+		if ( ! $episode_id || ! is_array ( $content_items ) || empty( $content_items ) ) {
1128 1128
 			return;
1129 1129
 		}
1130 1130
 
1131 1131
 		// Get episode object
1132
-		$episode = get_post( $episode_id );
1132
+		$episode = get_post ( $episode_id );
1133 1133
 
1134
-		if ( ! $episode || is_wp_error( $episode ) ) {
1134
+		if ( ! $episode || is_wp_error ( $episode ) ) {
1135 1135
 			return;
1136 1136
 		}
1137 1137
 
1138
-		$html = '<div class="podcast-episode episode-' . esc_attr( $episode_id ) . '">' . "\n";
1138
+		$html = '<div class="podcast-episode episode-'.esc_attr ( $episode_id ).'">'."\n";
1139 1139
 
1140 1140
 			// Setup post data for episode post object
1141 1141
 			$post = $episode;
1142
-			setup_postdata( $post );
1142
+			setup_postdata ( $post );
1143 1143
 
1144 1144
 			$episode_context = $context;
1145 1145
 
1146 1146
 			// Display specified content items in the order supplied
1147 1147
 			foreach ( $content_items as $item ) {
1148 1148
 
1149
-				switch( $item ) {
1149
+				switch ( $item ) {
1150 1150
 
1151 1151
 					case 'title':
1152
-						$html .= '<h3 class="episode-title">' . get_the_title() . '</h3>' . "\n";
1152
+						$html .= '<h3 class="episode-title">'.get_the_title ().'</h3>'."\n";
1153 1153
 					break;
1154 1154
 
1155 1155
 					case 'excerpt':
1156
-						$html .= '<p class="episode-excerpt">' . get_the_excerpt() . '</p>' . "\n";
1156
+						$html .= '<p class="episode-excerpt">'.get_the_excerpt ().'</p>'."\n";
1157 1157
 					break;
1158 1158
 
1159 1159
 					case 'content':
1160
-						$html .= '<div class="episode-content">' . apply_filters( 'the_content', get_the_content() ) . '</div>' . "\n";
1160
+						$html .= '<div class="episode-content">'.apply_filters ( 'the_content', get_the_content () ).'</div>'."\n";
1161 1161
 					break;
1162 1162
 
1163 1163
 					case 'player':
1164
-						$file = $this->get_enclosure( $episode_id );
1165
-						if ( get_option( 'permalink_structure' ) ) {
1166
-							$file = $this->get_episode_download_link( $episode_id );
1164
+						$file = $this->get_enclosure ( $episode_id );
1165
+						if ( get_option ( 'permalink_structure' ) ) {
1166
+							$file = $this->get_episode_download_link ( $episode_id );
1167 1167
 						}
1168
-		    			$html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n";
1168
+		    			$html .= '<div class="podcast_player">'.$this->media_player ( $file, $episode_id ).'</div>'."\n";
1169 1169
 					break;
1170 1170
 
1171 1171
 					case 'details':
1172
-						$html .= $this->episode_meta_details( $episode_id, $episode_context );
1172
+						$html .= $this->episode_meta_details ( $episode_id, $episode_context );
1173 1173
 					break;
1174 1174
 
1175 1175
 				}
1176 1176
 			}
1177 1177
 
1178 1178
 			// Reset post data after fetching episode details
1179
-			wp_reset_postdata();
1179
+			wp_reset_postdata ();
1180 1180
 
1181
-		$html .= '</div>' . "\n";
1181
+		$html .= '</div>'."\n";
1182 1182
 
1183 1183
 	    return $html;
1184 1184
 	}
@@ -1193,26 +1193,26 @@  discard block
 block discarded – undo
1193 1193
 	function get_local_file_path( $file ) {
1194 1194
 
1195 1195
 		// Identify file by root path and not URL (required for getID3 class)
1196
-		$site_root = trailingslashit( ABSPATH );
1196
+		$site_root = trailingslashit ( ABSPATH );
1197 1197
 
1198 1198
 		// Remove common dirs from the ends of site_url and site_root, so that file can be outside of the WordPress installation
1199
-		$root_chunks = explode( '/', $site_root );
1200
-		$url_chunks  = explode( '/', $this->site_url );
1199
+		$root_chunks = explode ( '/', $site_root );
1200
+		$url_chunks  = explode ( '/', $this->site_url );
1201 1201
 
1202
-		end( $root_chunks );
1203
-		end( $url_chunks );
1202
+		end ( $root_chunks );
1203
+		end ( $url_chunks );
1204 1204
 
1205
-		while ( ! is_null( key( $root_chunks ) ) && ! is_null( key( $url_chunks ) ) && ( current( $root_chunks ) == current( $url_chunks ) ) ) {
1206
-			array_pop( $root_chunks );
1207
-			array_pop( $url_chunks );
1208
-			end( $root_chunks );
1209
-			end( $url_chunks );
1205
+		while ( ! is_null ( key ( $root_chunks ) ) && ! is_null ( key ( $url_chunks ) ) && ( current ( $root_chunks ) == current ( $url_chunks ) ) ) {
1206
+			array_pop ( $root_chunks );
1207
+			array_pop ( $url_chunks );
1208
+			end ( $root_chunks );
1209
+			end ( $url_chunks );
1210 1210
 		}
1211 1211
 
1212
-		$site_root = implode('/', $root_chunks);
1213
-		$site_url  = implode('/', $url_chunks);
1212
+		$site_root = implode ( '/', $root_chunks );
1213
+		$site_url  = implode ( '/', $url_chunks );
1214 1214
 
1215
-		$file = str_replace( $site_url, $site_root, $file );
1215
+		$file = str_replace ( $site_url, $site_root, $file );
1216 1216
 
1217 1217
 		return $file;
1218 1218
 	}
@@ -1224,16 +1224,16 @@  discard block
 block discarded – undo
1224 1224
 	 * @param  string $type         Type of feed
1225 1225
 	 * @return string               Updated content type
1226 1226
 	 */
1227
-	public function feed_content_type ( $content_type = '', $type = '' ) {
1227
+	public function feed_content_type( $content_type = '', $type = '' ) {
1228 1228
 
1229
-		if( 'podcast' == $type ) {
1229
+		if ( 'podcast' == $type ) {
1230 1230
 			$content_type = 'text/xml';
1231 1231
 		}
1232 1232
 
1233 1233
 		return $content_type;
1234 1234
 	}
1235 1235
 
1236
-	public function load_localisation () {
1237
-		load_plugin_textdomain( 'seriously-simple-podcasting', false, basename( dirname( $this->file ) ) . '/languages/' );
1236
+	public function load_localisation() {
1237
+		load_plugin_textdomain ( 'seriously-simple-podcasting', false, basename ( dirname ( $this->file ) ).'/languages/' );
1238 1238
 	}
1239 1239
 }
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.
includes/shortcodes/class-ssp-shortcode-podcast_episode.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly.
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if ( ! defined ( 'ABSPATH' ) ) {
4 4
 	exit;
5 5
 }
6 6
 
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
 	 * @param  array  $params Shortcode paramaters
20 20
 	 * @return string         HTML output
21 21
 	 */
22
-	public function shortcode ( $params ) {
22
+	public function shortcode( $params ) {
23 23
 		global $ss_podcasting;
24 24
 
25
-		$atts = shortcode_atts( array(
25
+		$atts = shortcode_atts ( array(
26 26
 	        'episode' => 0,
27 27
 	        'content' => 'title,player,details',
28 28
 	    ), $params );
29 29
 
30
-		extract( $atts );
30
+		extract ( $atts );
31 31
 
32 32
 		// If no episode ID is specified then use the current post's ID
33 33
 	    if ( ! $episode ) {
34 34
 
35 35
 	    	global $post;
36
-	    	if( isset( $post->ID ) ) {
37
-	    		$episode = intval( $post->ID );
36
+	    	if ( isset( $post->ID ) ) {
37
+	    		$episode = intval ( $post->ID );
38 38
 	    	}
39 39
 
40 40
 	    	if ( ! $episode ) {
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 	    }
45 45
 
46 46
 	    // Setup array of content items and trim whitespace
47
-	    $content_items = explode( ',', $content );
48
-	    $content_items = array_map( 'trim', $content_items );
47
+	    $content_items = explode ( ',', $content );
48
+	    $content_items = array_map ( 'trim', $content_items );
49 49
 
50 50
 	    // Get episode for display
51
-	    $html = $ss_podcasting->podcast_episode( $episode, $content_items, 'shortcode' );
51
+	    $html = $ss_podcasting->podcast_episode ( $episode, $content_items, 'shortcode' );
52 52
 
53 53
 	    return $html;
54 54
 
@@ -56,4 +56,4 @@  discard block
 block discarded – undo
56 56
 
57 57
 }
58 58
 
59
-$GLOBALS['ssp_shortcodes']['podcast_episode'] = new SSP_Shortcode_Podcast_Episode();
60 59
\ No newline at end of file
60
+$GLOBALS[ 'ssp_shortcodes' ][ 'podcast_episode' ] = new SSP_Shortcode_Podcast_Episode ();
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -23,34 +23,34 @@
 block discarded – undo
23 23
 		global $ss_podcasting;
24 24
 
25 25
 		$atts = shortcode_atts( array(
26
-	        'episode' => 0,
27
-	        'content' => 'title,player,details',
28
-	    ), $params, 'podcast_episode' );
26
+			'episode' => 0,
27
+			'content' => 'title,player,details',
28
+		), $params, 'podcast_episode' );
29 29
 
30 30
 		extract( $atts );
31 31
 
32 32
 		// If no episode ID is specified then use the current post's ID
33
-	    if ( ! $episode ) {
33
+		if ( ! $episode ) {
34 34
 
35
-	    	global $post;
36
-	    	if( isset( $post->ID ) ) {
37
-	    		$episode = intval( $post->ID );
38
-	    	}
35
+			global $post;
36
+			if( isset( $post->ID ) ) {
37
+				$episode = intval( $post->ID );
38
+			}
39 39
 
40
-	    	if ( ! $episode ) {
41
-	    		return;
42
-	    	}
40
+			if ( ! $episode ) {
41
+				return;
42
+			}
43 43
 
44
-	    }
44
+		}
45 45
 
46
-	    // Setup array of content items and trim whitespace
47
-	    $content_items = explode( ',', $content );
48
-	    $content_items = array_map( 'trim', $content_items );
46
+		// Setup array of content items and trim whitespace
47
+		$content_items = explode( ',', $content );
48
+		$content_items = array_map( 'trim', $content_items );
49 49
 
50
-	    // Get episode for display
51
-	    $html = $ss_podcasting->podcast_episode( $episode, $content_items, 'shortcode' );
50
+		// Get episode for display
51
+		$html = $ss_podcasting->podcast_episode( $episode, $content_items, 'shortcode' );
52 52
 
53
-	    return $html;
53
+		return $html;
54 54
 
55 55
 	}
56 56
 
Please login to merge, or discard this patch.