Completed
Push — master ( 438bdf...d0f89d )
by Hugh
02:37
created
includes/class-ssp-frontend.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -559,11 +559,11 @@  discard block
 block discarded – undo
559 559
 
560 560
 		if ( $size ) {
561 561
 
562
-		    $base = log ( $size ) / log( 1024 );
563
-		    $suffixes = array( '' , 'k' , 'M' , 'G' , 'T' );
564
-		    $formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ];
562
+			$base = log ( $size ) / log( 1024 );
563
+			$suffixes = array( '' , 'k' , 'M' , 'G' , 'T' );
564
+			$formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ];
565 565
 
566
-		    return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size );
566
+			return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size );
567 567
 		}
568 568
 
569 569
 		return false;
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 				wp_cache_set( $key, $mime, 'mime-type', DAY_IN_SECONDS );
666 666
 			}
667 667
 
668
-		    return $mime;
668
+			return $mime;
669 669
 		}
670 670
 
671 671
 		return false;
@@ -799,15 +799,15 @@  discard block
 block discarded – undo
799 799
 				foreach ( $terms as $term ) {
800 800
 					$query[ $term->term_id ] = new stdClass();
801 801
 					$query[ $term->term_id ]->title = $term->name;
802
-		    		$query[ $term->term_id ]->url = get_term_link( $term );
802
+					$query[ $term->term_id ]->url = get_term_link( $term );
803 803
 
804
-		    		$query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) );
804
+					$query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) );
805 805
 
806
-		    		$posts = get_posts( $query_args );
806
+					$posts = get_posts( $query_args );
807 807
 
808
-		    		$count = count( $posts );
809
-		    		$query[ $term->term_id ]->count = $count;
810
-			    }
808
+					$count = count( $posts );
809
+					$query[ $term->term_id ]->count = $count;
810
+				}
811 811
 			}
812 812
 
813 813
 		}
@@ -918,18 +918,18 @@  discard block
 block discarded – undo
918 918
 				}
919 919
 
920 920
 				// Allow other actions - functions hooked on here must not output any data
921
-			    do_action( 'ssp_file_download', $file, $episode, $referrer );
921
+				do_action( 'ssp_file_download', $file, $episode, $referrer );
922 922
 
923
-			    // Set necessary headers
923
+				// Set necessary headers
924 924
 				header( "Pragma: no-cache" );
925 925
 				header( "Expires: 0" );
926 926
 				header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
927 927
 				header( "Robots: none" );
928 928
 
929
-		        // Check file referrer
930
-		        if( 'download' == $referrer ) {
929
+				// Check file referrer
930
+				if( 'download' == $referrer ) {
931 931
 
932
-		        	// Set size of file
932
+					// Set size of file
933 933
 					// Do we have anything in Cache/DB?
934 934
 					$size = wp_cache_get( $episode_id, 'filesize_raw' );
935 935
 
@@ -956,22 +956,22 @@  discard block
 block discarded – undo
956 956
 					}
957 957
 
958 958
 					// Send Content-Length header
959
-		        	if ( ! empty( $size ) ) {
959
+					if ( ! empty( $size ) ) {
960 960
 						header( "Content-Length: " . $size );
961 961
 					}
962 962
 
963
-		        	// Force file download
964
-		        	header( "Content-Type: application/force-download" );
963
+					// Force file download
964
+					header( "Content-Type: application/force-download" );
965 965
 
966
-			        // Set other relevant headers
967
-			        header( "Content-Description: File Transfer" );
968
-			        header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" );
969
-			        header( "Content-Transfer-Encoding: binary" );
966
+					// Set other relevant headers
967
+					header( "Content-Description: File Transfer" );
968
+					header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" );
969
+					header( "Content-Transfer-Encoding: binary" );
970 970
 
971
-			        // Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
971
+					// Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998)
972 972
 					$file = str_replace( ' ', '%20', $file );
973 973
 
974
-			        // Use ssp_readfile_chunked() if allowed on the server or simply access file directly
974
+					// Use ssp_readfile_chunked() if allowed on the server or simply access file directly
975 975
 					@ssp_readfile_chunked( $file ) or header( 'Location: ' . $file );
976 976
 				} else {
977 977
 
@@ -1090,34 +1090,34 @@  discard block
 block discarded – undo
1090 1090
 	public function podcast_episode_shortcode ( $params ) {
1091 1091
 
1092 1092
 		$atts = shortcode_atts( array(
1093
-	        'episode' => 0,
1094
-	        'content' => 'title,player,details',
1095
-	    ), $params );
1093
+			'episode' => 0,
1094
+			'content' => 'title,player,details',
1095
+		), $params );
1096 1096
 
1097 1097
 		extract( $atts );
1098 1098
 
1099 1099
 		// If no episode ID is specified then use the current post's ID
1100
-	    if ( ! $episode ) {
1100
+		if ( ! $episode ) {
1101 1101
 
1102
-	    	global $post;
1103
-	    	if( isset( $post->ID ) ) {
1104
-	    		$episode = intval( $post->ID );
1105
-	    	}
1102
+			global $post;
1103
+			if( isset( $post->ID ) ) {
1104
+				$episode = intval( $post->ID );
1105
+			}
1106 1106
 
1107
-	    	if ( ! $episode ) {
1108
-	    		return;
1109
-	    	}
1107
+			if ( ! $episode ) {
1108
+				return;
1109
+			}
1110 1110
 
1111
-	    }
1111
+		}
1112 1112
 
1113
-	    // Setup array of content items and trim whitespace
1114
-	    $content_items = explode( ',', $content );
1115
-	    $content_items = array_map( 'trim', $content_items );
1113
+		// Setup array of content items and trim whitespace
1114
+		$content_items = explode( ',', $content );
1115
+		$content_items = array_map( 'trim', $content_items );
1116 1116
 
1117
-	    // Get episode for display
1118
-	    $html = $this->podcast_episode( $episode, $content_items, 'shortcode' );
1117
+		// Get episode for display
1118
+		$html = $this->podcast_episode( $episode, $content_items, 'shortcode' );
1119 1119
 
1120
-	    return $html;
1120
+		return $html;
1121 1121
 
1122 1122
 	}
1123 1123
 
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
 						if ( get_option( 'permalink_structure' ) ) {
1172 1172
 							$file = $this->get_episode_download_link( $episode_id );
1173 1173
 						}
1174
-		    			$html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n";
1174
+						$html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n";
1175 1175
 					break;
1176 1176
 
1177 1177
 					case 'details':
@@ -1186,7 +1186,7 @@  discard block
 block discarded – undo
1186 1186
 
1187 1187
 		$html .= '</div>' . "\n";
1188 1188
 
1189
-	    return $html;
1189
+		return $html;
1190 1190
 	}
1191 1191
 
1192 1192
 	/**
Please login to merge, or discard this patch.