Completed
Push — master ( 60090c...ef8f94 )
by Hugh
09:38 queued 06:51
created
seriously-simple-podcasting.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly.
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined ( 'ABSPATH' ) ) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 require_once( 'includes/class-ssp-frontend.php' );
23 23
 
24 24
 global $ssp_admin, $ss_podcasting;
25
-$ssp_admin = new SSP_Admin( __FILE__, '1.15.0' );
26
-$ss_podcasting = new SSP_Frontend( __FILE__, '1.15.0' );
25
+$ssp_admin = new SSP_Admin ( __FILE__, '1.15.0' );
26
+$ss_podcasting = new SSP_Frontend ( __FILE__, '1.15.0' );
27 27
 
28
-if ( is_admin() ) {
28
+if ( is_admin () ) {
29 29
 	global $ssp_settings;
30 30
 	require_once( 'includes/class-ssp-settings.php' );
31
-	$ssp_settings = new SSP_Settings( __FILE__ );
31
+	$ssp_settings = new SSP_Settings ( __FILE__ );
32 32
 }
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
includes/class-ssp-admin.php 1 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-frontend.php 1 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.