| @@ -928,15 +928,15 @@ discard block | ||
| 928 | 928 |  		if ( $message ) { | 
| 929 | 929 | |
| 930 | 930 | $allowed = array( | 
| 931 | - 'a' => array( | |
| 932 | - 'href' => array(), | |
| 933 | - 'title' => array(), | |
| 934 | - 'target' => array() | |
| 935 | - ), | |
| 936 | - 'br' => array(), | |
| 937 | - 'em' => array(), | |
| 938 | - 'strong' => array(), | |
| 939 | - 'p' => array() | |
| 931 | + 'a' => array( | |
| 932 | + 'href' => array(), | |
| 933 | + 'title' => array(), | |
| 934 | + 'target' => array() | |
| 935 | + ), | |
| 936 | + 'br' => array(), | |
| 937 | + 'em' => array(), | |
| 938 | + 'strong' => array(), | |
| 939 | + 'p' => array() | |
| 940 | 940 | ); | 
| 941 | 941 | |
| 942 | 942 | $message = wp_kses( $message, $allowed ); | 
| @@ -1026,7 +1026,7 @@ discard block | ||
| 1026 | 1026 |  			if( function_exists( 'php_sapi_name') && 'security' == $tab ) { | 
| 1027 | 1027 | $sapi_type = php_sapi_name(); | 
| 1028 | 1028 |  				if ( strpos( $sapi_type, 'fcgi' ) !== false ) { | 
| 1029 | - $html .= '<br/><div class="update-nag"> | |
| 1029 | + $html .= '<br/><div class="update-nag"> | |
| 1030 | 1030 | <p>' . sprintf( __( 'It looks like your server has FastCGI enabled, which will prevent the feed password protection feature from working. You can fix this by following %1$sthis quick guide%2$s.', 'seriously-simple-podcasting' ), '<a href="http://www.seriouslysimplepodcasting.com/documentation/why-does-the-feed-password-protection-feature-not-work/" target="_blank">', '</a>' ) . '</p> | 
| 1031 | 1031 | </div>'; | 
| 1032 | 1032 | } | 
| @@ -406,7 +406,7 @@ discard block | ||
| 406 | 406 | * @since 1.0.0 | 
| 407 | 407 | * @return mixed | 
| 408 | 408 | */ | 
| 409 | -    function ssp_readfile_chunked( $file, $retbytes = true ) { | |
| 409 | +	function ssp_readfile_chunked( $file, $retbytes = true ) { | |
| 410 | 410 | |
| 411 | 411 | $chunksize = 1 * ( 1024 * 1024 ); | 
| 412 | 412 | $cnt = 0; | 
| @@ -434,5 +434,5 @@ discard block | ||
| 434 | 434 | } | 
| 435 | 435 | |
| 436 | 436 | return $status; | 
| 437 | - } | |
| 437 | + } | |
| 438 | 438 | } | 
| 439 | 439 | \ No newline at end of file | 
| @@ -127,7 +127,9 @@ | ||
| 127 | 127 | $i = 0; | 
| 128 | 128 |  				foreach ( $query as $series ) { | 
| 129 | 129 | |
| 130 | - if ( ! is_object( $series ) ) continue; | |
| 130 | +					if ( ! is_object( $series ) ) { | |
| 131 | + continue; | |
| 132 | + } | |
| 131 | 133 | |
| 132 | 134 | $template = $tpl; | 
| 133 | 135 | $i++; | 
| @@ -32,7 +32,7 @@ discard block | ||
| 32 | 32 | |
| 33 | 33 | // Request password and give access if correct | 
| 34 | 34 |  	if ( ! isset( $_SERVER['PHP_AUTH_USER'] ) && ! isset( $_SERVER['PHP_AUTH_PW'] ) ) { | 
| 35 | - $give_access = false; | |
| 35 | + $give_access = false; | |
| 36 | 36 |  	} else { | 
| 37 | 37 | $username = get_option( 'ss_podcasting_protection_username' ); | 
| 38 | 38 | $password = get_option( 'ss_podcasting_protection_password' ); | 
| @@ -50,7 +50,7 @@ discard block | ||
| 50 | 50 | $no_access_message = '<div style="text-align:center;font-family:sans-serif;border:1px solid red;background:pink;padding:20px 0;color:red;">' . $message . '</div>'; | 
| 51 | 51 | |
| 52 | 52 |  		header('WWW-Authenticate: Basic realm="Podcast Feed"'); | 
| 53 | -	    header('HTTP/1.0 401 Unauthorized'); | |
| 53 | +		header('HTTP/1.0 401 Unauthorized'); | |
| 54 | 54 | |
| 55 | 55 | die( $no_access_message ); | 
| 56 | 56 | } | 
| @@ -556,11 +556,11 @@ discard block | ||
| 556 | 556 | |
| 557 | 557 |  		if ( $size ) { | 
| 558 | 558 | |
| 559 | - $base = log ( $size ) / log( 1024 ); | |
| 560 | - $suffixes = array( '' , 'k' , 'M' , 'G' , 'T' ); | |
| 561 | - $formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ]; | |
| 559 | + $base = log ( $size ) / log( 1024 ); | |
| 560 | + $suffixes = array( '' , 'k' , 'M' , 'G' , 'T' ); | |
| 561 | + $formatted_size = round( pow( 1024 , $base - floor( $base ) ) , $precision ) . $suffixes[ floor( $base ) ]; | |
| 562 | 562 | |
| 563 | - return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size ); | |
| 563 | + return apply_filters( 'ssp_file_size_formatted', $formatted_size, $size ); | |
| 564 | 564 | } | 
| 565 | 565 | |
| 566 | 566 | return false; | 
| @@ -662,7 +662,7 @@ discard block | ||
| 662 | 662 | wp_cache_set( $key, $mime, 'mime-type', DAY_IN_SECONDS ); | 
| 663 | 663 | } | 
| 664 | 664 | |
| 665 | - return $mime; | |
| 665 | + return $mime; | |
| 666 | 666 | } | 
| 667 | 667 | |
| 668 | 668 | return false; | 
| @@ -796,15 +796,15 @@ discard block | ||
| 796 | 796 |  				foreach ( $terms as $term ) { | 
| 797 | 797 | $query[ $term->term_id ] = new stdClass(); | 
| 798 | 798 | $query[ $term->term_id ]->title = $term->name; | 
| 799 | - $query[ $term->term_id ]->url = get_term_link( $term ); | |
| 799 | + $query[ $term->term_id ]->url = get_term_link( $term ); | |
| 800 | 800 | |
| 801 | - $query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) ); | |
| 801 | + $query_args = apply_filters( 'ssp_get_podcast_series_query_args', ssp_episodes( -1, $term->slug, true, '' ) ); | |
| 802 | 802 | |
| 803 | - $posts = get_posts( $query_args ); | |
| 803 | + $posts = get_posts( $query_args ); | |
| 804 | 804 | |
| 805 | - $count = count( $posts ); | |
| 806 | - $query[ $term->term_id ]->count = $count; | |
| 807 | - } | |
| 805 | + $count = count( $posts ); | |
| 806 | + $query[ $term->term_id ]->count = $count; | |
| 807 | + } | |
| 808 | 808 | } | 
| 809 | 809 | |
| 810 | 810 | } | 
| @@ -914,18 +914,18 @@ discard block | ||
| 914 | 914 | } | 
| 915 | 915 | |
| 916 | 916 | // Allow other actions - functions hooked on here must not output any data | 
| 917 | - do_action( 'ssp_file_download', $file, $episode, $referrer ); | |
| 917 | + do_action( 'ssp_file_download', $file, $episode, $referrer ); | |
| 918 | 918 | |
| 919 | - // Set necessary headers | |
| 919 | + // Set necessary headers | |
| 920 | 920 | header( "Pragma: no-cache" ); | 
| 921 | 921 | header( "Expires: 0" ); | 
| 922 | 922 | header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" ); | 
| 923 | 923 | header( "Robots: none" ); | 
| 924 | 924 | |
| 925 | - // Check file referrer | |
| 926 | -		        if( 'download' == $referrer ) { | |
| 925 | + // Check file referrer | |
| 926 | +				if( 'download' == $referrer ) { | |
| 927 | 927 | |
| 928 | - // Set size of file | |
| 928 | + // Set size of file | |
| 929 | 929 | // Do we have anything in Cache/DB? | 
| 930 | 930 | $size = wp_cache_get( $episode_id, 'filesize_raw' ); | 
| 931 | 931 | |
| @@ -952,22 +952,22 @@ discard block | ||
| 952 | 952 | } | 
| 953 | 953 | |
| 954 | 954 | // Send Content-Length header | 
| 955 | -		        	if ( ! empty( $size ) ) { | |
| 955 | +					if ( ! empty( $size ) ) { | |
| 956 | 956 | header( "Content-Length: " . $size ); | 
| 957 | 957 | } | 
| 958 | 958 | |
| 959 | - // Force file download | |
| 960 | - header( "Content-Type: application/force-download" ); | |
| 959 | + // Force file download | |
| 960 | + header( "Content-Type: application/force-download" ); | |
| 961 | 961 | |
| 962 | - // Set other relevant headers | |
| 963 | - header( "Content-Description: File Transfer" ); | |
| 964 | - header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" ); | |
| 965 | - header( "Content-Transfer-Encoding: binary" ); | |
| 962 | + // Set other relevant headers | |
| 963 | + header( "Content-Description: File Transfer" ); | |
| 964 | + header( "Content-Disposition: attachment; filename=\"" . basename( $file ) . "\";" ); | |
| 965 | + header( "Content-Transfer-Encoding: binary" ); | |
| 966 | 966 | |
| 967 | - // Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998) | |
| 967 | + // Encode spaces in file names until this is fixed in core (https://core.trac.wordpress.org/ticket/36998) | |
| 968 | 968 | $file = str_replace( ' ', '%20', $file ); | 
| 969 | 969 | |
| 970 | - // Use ssp_readfile_chunked() if allowed on the server or simply access file directly | |
| 970 | + // Use ssp_readfile_chunked() if allowed on the server or simply access file directly | |
| 971 | 971 | @ssp_readfile_chunked( $file ) or header( 'Location: ' . $file ); | 
| 972 | 972 |  				} else { | 
| 973 | 973 | |
| @@ -1086,24 +1086,24 @@ discard block | ||
| 1086 | 1086 |  	public function podcast_episode_shortcode ( $params ) { | 
| 1087 | 1087 | |
| 1088 | 1088 | $atts = shortcode_atts( array( | 
| 1089 | - 'episode' => 0, | |
| 1090 | - 'content' => 'title,player,details', | |
| 1091 | - ), $params ); | |
| 1089 | + 'episode' => 0, | |
| 1090 | + 'content' => 'title,player,details', | |
| 1091 | + ), $params ); | |
| 1092 | 1092 | |
| 1093 | 1093 | extract( $atts ); | 
| 1094 | 1094 | |
| 1095 | -	    if ( ! $episode ) { | |
| 1096 | - return; | |
| 1097 | - } | |
| 1095 | +		if ( ! $episode ) { | |
| 1096 | + return; | |
| 1097 | + } | |
| 1098 | 1098 | |
| 1099 | - // Setup array of content items and trim whitespace | |
| 1100 | - $content_items = explode( ',', $content ); | |
| 1101 | - $content_items = array_map( 'trim', $content_items ); | |
| 1099 | + // Setup array of content items and trim whitespace | |
| 1100 | + $content_items = explode( ',', $content ); | |
| 1101 | + $content_items = array_map( 'trim', $content_items ); | |
| 1102 | 1102 | |
| 1103 | - // Get episode for display | |
| 1104 | - $html = $this->podcast_episode( $episode, $content_items, 'shortcode' ); | |
| 1103 | + // Get episode for display | |
| 1104 | + $html = $this->podcast_episode( $episode, $content_items, 'shortcode' ); | |
| 1105 | 1105 | |
| 1106 | - return $html; | |
| 1106 | + return $html; | |
| 1107 | 1107 | |
| 1108 | 1108 | } | 
| 1109 | 1109 | |
| @@ -1157,7 +1157,7 @@ discard block | ||
| 1157 | 1157 |  						if ( get_option( 'permalink_structure' ) ) { | 
| 1158 | 1158 | $file = $this->get_episode_download_link( $episode_id ); | 
| 1159 | 1159 | } | 
| 1160 | - $html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n"; | |
| 1160 | + $html .= '<div class="podcast_player">' . $this->media_player( $file, $episode_id ) . '</div>' . "\n"; | |
| 1161 | 1161 | break; | 
| 1162 | 1162 | |
| 1163 | 1163 | case 'details': | 
| @@ -1172,7 +1172,7 @@ discard block | ||
| 1172 | 1172 | |
| 1173 | 1173 | $html .= '</div>' . "\n"; | 
| 1174 | 1174 | |
| 1175 | - return $html; | |
| 1175 | + return $html; | |
| 1176 | 1176 | } | 
| 1177 | 1177 | |
| 1178 | 1178 | /** | 
| @@ -83,19 +83,19 @@ discard block | ||
| 83 | 83 | |
| 84 | 84 | // Series list table | 
| 85 | 85 | add_filter( 'manage_edit-series_columns' , array( $this, 'edit_series_columns' ) ); | 
| 86 | - add_filter( 'manage_series_custom_column' , array( $this, 'add_series_columns' ), 1, 3 ); | |
| 86 | + add_filter( 'manage_series_custom_column' , array( $this, 'add_series_columns' ), 1, 3 ); | |
| 87 | 87 | |
| 88 | - // Dashboard widgets | |
| 89 | - add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 ); | |
| 88 | + // Dashboard widgets | |
| 89 | + add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 ); | |
| 90 | 90 | |
| 91 | - // Appreciation links | |
| 92 | - add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 ); | |
| 91 | + // Appreciation links | |
| 92 | + add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 ); | |
| 93 | 93 | |
| 94 | - // Add footer text to dashboard | |
| 95 | - add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 ); | |
| 94 | + // Add footer text to dashboard | |
| 95 | + add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 ); | |
| 96 | 96 | |
| 97 | - // Clear the cache on post save. | |
| 98 | - add_action( 'save_post', array( $this, 'invalidate_cache' ), 10, 2 ); | |
| 97 | + // Clear the cache on post save. | |
| 98 | + add_action( 'save_post', array( $this, 'invalidate_cache' ), 10, 2 ); | |
| 99 | 99 | |
| 100 | 100 | } | 
| 101 | 101 | |
| @@ -194,47 +194,47 @@ discard block | ||
| 194 | 194 | |
| 195 | 195 | $podcast_post_types = ssp_post_types( true ); | 
| 196 | 196 | |
| 197 | - $series_labels = array( | |
| 198 | - 'name' => __( 'Podcast Series' , 'seriously-simple-podcasting' ), | |
| 199 | - 'singular_name' => __( 'Series', 'seriously-simple-podcasting' ), | |
| 200 | - 'search_items' => __( 'Search Series' , 'seriously-simple-podcasting' ), | |
| 201 | - 'all_items' => __( 'All Series' , 'seriously-simple-podcasting' ), | |
| 202 | - 'parent_item' => __( 'Parent Series' , 'seriously-simple-podcasting' ), | |
| 203 | - 'parent_item_colon' => __( 'Parent Series:' , 'seriously-simple-podcasting' ), | |
| 204 | - 'edit_item' => __( 'Edit Series' , 'seriously-simple-podcasting' ), | |
| 205 | - 'update_item' => __( 'Update Series' , 'seriously-simple-podcasting' ), | |
| 206 | - 'add_new_item' => __( 'Add New Series' , 'seriously-simple-podcasting' ), | |
| 207 | - 'new_item_name' => __( 'New Series Name' , 'seriously-simple-podcasting' ), | |
| 208 | - 'menu_name' => __( 'Series' , 'seriously-simple-podcasting' ), | |
| 209 | - 'view_item' => __( 'View Series' , 'seriously-simple-podcasting' ), | |
| 210 | - 'popular_items' => __( 'Popular Series' , 'seriously-simple-podcasting' ), | |
| 211 | - 'separate_items_with_commas' => __( 'Separate series with commas' , 'seriously-simple-podcasting' ), | |
| 212 | - 'add_or_remove_items' => __( 'Add or remove Series' , 'seriously-simple-podcasting' ), | |
| 213 | - 'choose_from_most_used' => __( 'Choose from the most used Series' , 'seriously-simple-podcasting' ), | |
| 214 | - 'not_found' => __( 'No Series Found' , 'seriously-simple-podcasting' ), | |
| 215 | - 'items_list_navigation' => __( 'Series list navigation' , 'seriously-simple-podcasting' ), | |
| 216 | - 'items_list' => __( 'Series list' , 'seriously-simple-podcasting' ), | |
| 217 | - ); | |
| 218 | - | |
| 219 | - $series_args = array( | |
| 220 | - 'public' => true, | |
| 221 | - 'hierarchical' => true, | |
| 222 | - 'rewrite' => array( 'slug' => apply_filters( 'ssp_series_slug', 'series' ) ), | |
| 223 | - 'labels' => $series_labels, | |
| 224 | - 'show_in_rest' => true, | |
| 225 | - ); | |
| 226 | - | |
| 227 | - $series_args = apply_filters( 'ssp_register_taxonomy_args', $series_args, 'series' ); | |
| 228 | - | |
| 229 | - register_taxonomy( 'series', $podcast_post_types, $series_args ); | |
| 230 | - | |
| 231 | - // Add Tags to podcast post type | |
| 232 | -        if ( apply_filters( 'ssp_use_post_tags', true ) ) { | |
| 233 | - register_taxonomy_for_object_type( 'post_tag', $this->token ); | |
| 234 | - } | |
| 235 | - } | |
| 236 | - | |
| 237 | - /** | |
| 197 | + $series_labels = array( | |
| 198 | + 'name' => __( 'Podcast Series' , 'seriously-simple-podcasting' ), | |
| 199 | + 'singular_name' => __( 'Series', 'seriously-simple-podcasting' ), | |
| 200 | + 'search_items' => __( 'Search Series' , 'seriously-simple-podcasting' ), | |
| 201 | + 'all_items' => __( 'All Series' , 'seriously-simple-podcasting' ), | |
| 202 | + 'parent_item' => __( 'Parent Series' , 'seriously-simple-podcasting' ), | |
| 203 | + 'parent_item_colon' => __( 'Parent Series:' , 'seriously-simple-podcasting' ), | |
| 204 | + 'edit_item' => __( 'Edit Series' , 'seriously-simple-podcasting' ), | |
| 205 | + 'update_item' => __( 'Update Series' , 'seriously-simple-podcasting' ), | |
| 206 | + 'add_new_item' => __( 'Add New Series' , 'seriously-simple-podcasting' ), | |
| 207 | + 'new_item_name' => __( 'New Series Name' , 'seriously-simple-podcasting' ), | |
| 208 | + 'menu_name' => __( 'Series' , 'seriously-simple-podcasting' ), | |
| 209 | + 'view_item' => __( 'View Series' , 'seriously-simple-podcasting' ), | |
| 210 | + 'popular_items' => __( 'Popular Series' , 'seriously-simple-podcasting' ), | |
| 211 | + 'separate_items_with_commas' => __( 'Separate series with commas' , 'seriously-simple-podcasting' ), | |
| 212 | + 'add_or_remove_items' => __( 'Add or remove Series' , 'seriously-simple-podcasting' ), | |
| 213 | + 'choose_from_most_used' => __( 'Choose from the most used Series' , 'seriously-simple-podcasting' ), | |
| 214 | + 'not_found' => __( 'No Series Found' , 'seriously-simple-podcasting' ), | |
| 215 | + 'items_list_navigation' => __( 'Series list navigation' , 'seriously-simple-podcasting' ), | |
| 216 | + 'items_list' => __( 'Series list' , 'seriously-simple-podcasting' ), | |
| 217 | + ); | |
| 218 | + | |
| 219 | + $series_args = array( | |
| 220 | + 'public' => true, | |
| 221 | + 'hierarchical' => true, | |
| 222 | + 'rewrite' => array( 'slug' => apply_filters( 'ssp_series_slug', 'series' ) ), | |
| 223 | + 'labels' => $series_labels, | |
| 224 | + 'show_in_rest' => true, | |
| 225 | + ); | |
| 226 | + | |
| 227 | + $series_args = apply_filters( 'ssp_register_taxonomy_args', $series_args, 'series' ); | |
| 228 | + | |
| 229 | + register_taxonomy( 'series', $podcast_post_types, $series_args ); | |
| 230 | + | |
| 231 | + // Add Tags to podcast post type | |
| 232 | +		if ( apply_filters( 'ssp_use_post_tags', true ) ) { | |
| 233 | + register_taxonomy_for_object_type( 'post_tag', $this->token ); | |
| 234 | + } | |
| 235 | + } | |
| 236 | + | |
| 237 | + /** | |
| 238 | 238 | * Register columns for podcast list table | 
| 239 | 239 | * @param array $defaults Default columns | 
| 240 | 240 | * @return array Modified columns | 
| @@ -251,12 +251,12 @@ discard block | ||
| 251 | 251 | return $columns; | 
| 252 | 252 | } | 
| 253 | 253 | |
| 254 | - /** | |
| 255 | - * Display column data in podcast list table | |
| 256 | - * @param string $column_name Name of current column | |
| 257 | - * @param integer $id ID of episode | |
| 258 | - * @return void | |
| 259 | - */ | |
| 254 | + /** | |
| 255 | + * Display column data in podcast list table | |
| 256 | + * @param string $column_name Name of current column | |
| 257 | + * @param integer $id ID of episode | |
| 258 | + * @return void | |
| 259 | + */ | |
| 260 | 260 |  	public function register_custom_columns( $column_name, $id ) { | 
| 261 | 261 | global $ss_podcasting; | 
| 262 | 262 | |
| @@ -286,34 +286,34 @@ discard block | ||
| 286 | 286 | */ | 
| 287 | 287 |  	public function edit_series_columns( $columns ) { | 
| 288 | 288 | |
| 289 | - unset( $columns['description'] ); | |
| 290 | - unset( $columns['posts'] ); | |
| 289 | + unset( $columns['description'] ); | |
| 290 | + unset( $columns['posts'] ); | |
| 291 | 291 | |
| 292 | - $columns['series_feed_url'] = __( 'Series feed URL' , 'seriously-simple-podcasting' ); | |
| 293 | - $columns['posts'] = __( 'Episodes' , 'seriously-simple-podcasting' ); | |
| 292 | + $columns['series_feed_url'] = __( 'Series feed URL' , 'seriously-simple-podcasting' ); | |
| 293 | + $columns['posts'] = __( 'Episodes' , 'seriously-simple-podcasting' ); | |
| 294 | 294 | |
| 295 | - $columns = apply_filters( 'ssp_admin_columns_series', $columns ); | |
| 295 | + $columns = apply_filters( 'ssp_admin_columns_series', $columns ); | |
| 296 | 296 | |
| 297 | - return $columns; | |
| 298 | - } | |
| 297 | + return $columns; | |
| 298 | + } | |
| 299 | 299 | |
| 300 | - /** | |
| 301 | - * Display column data in series list table | |
| 302 | - * | |
| 303 | - * @param string $column_data Default column content | |
| 304 | - * @param string $column_name Name of current column | |
| 305 | - * @param integer $term_id ID of term | |
| 306 | - * | |
| 307 | - * @return string | |
| 308 | - */ | |
| 309 | -    public function add_series_columns( $column_data , $column_name , $term_id ) { | |
| 300 | + /** | |
| 301 | + * Display column data in series list table | |
| 302 | + * | |
| 303 | + * @param string $column_data Default column content | |
| 304 | + * @param string $column_name Name of current column | |
| 305 | + * @param integer $term_id ID of term | |
| 306 | + * | |
| 307 | + * @return string | |
| 308 | + */ | |
| 309 | +	public function add_series_columns( $column_data , $column_name , $term_id ) { | |
| 310 | 310 | |
| 311 | -        switch ( $column_name ) { | |
| 312 | - case 'series_feed_url': | |
| 313 | - $series = get_term( $term_id, 'series' ); | |
| 314 | - $series_slug = $series->slug; | |
| 311 | +		switch ( $column_name ) { | |
| 312 | + case 'series_feed_url': | |
| 313 | + $series = get_term( $term_id, 'series' ); | |
| 314 | + $series_slug = $series->slug; | |
| 315 | 315 | |
| 316 | -            	if ( get_option( 'permalink_structure' ) ) { | |
| 316 | +				if ( get_option( 'permalink_structure' ) ) { | |
| 317 | 317 | $feed_slug = apply_filters( 'ssp_feed_slug', $this->token ); | 
| 318 | 318 | $feed_url = $this->home_url . 'feed/' . $feed_slug . '/' . $series_slug; | 
| 319 | 319 |  				} else { | 
| @@ -326,33 +326,33 @@ discard block | ||
| 326 | 326 | ); | 
| 327 | 327 | } | 
| 328 | 328 | |
| 329 | - $column_data = '<a href="' . esc_attr( $feed_url ) . '" target="_blank">' . esc_html( $feed_url ) . '</a>'; | |
| 330 | - break; | |
| 331 | - } | |
| 329 | + $column_data = '<a href="' . esc_attr( $feed_url ) . '" target="_blank">' . esc_html( $feed_url ) . '</a>'; | |
| 330 | + break; | |
| 331 | + } | |
| 332 | 332 | |
| 333 | - return $column_data; | |
| 334 | - } | |
| 333 | + return $column_data; | |
| 334 | + } | |
| 335 | 335 | |
| 336 | - /** | |
| 337 | - * Create custom dashboard message | |
| 338 | - * @param array $messages Default messages | |
| 339 | - * @return array Modified messages | |
| 340 | - */ | |
| 336 | + /** | |
| 337 | + * Create custom dashboard message | |
| 338 | + * @param array $messages Default messages | |
| 339 | + * @return array Modified messages | |
| 340 | + */ | |
| 341 | 341 |  	public function updated_messages( $messages ) { | 
| 342 | 342 | global $post, $post_ID; | 
| 343 | 343 | |
| 344 | 344 | $messages[ $this->token ] = array( | 
| 345 | - 0 => '', | |
| 346 | - 1 => sprintf( __( 'Episode updated. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ), | |
| 347 | - 2 => __( 'Custom field updated.' , 'seriously-simple-podcasting' ), | |
| 348 | - 3 => __( 'Custom field deleted.' , 'seriously-simple-podcasting' ), | |
| 349 | - 4 => __( 'Episode updated.' , 'seriously-simple-podcasting' ), | |
| 350 | - 5 => isset($_GET['revision']) ? sprintf( __( 'Episode restored to revision from %s.' , 'seriously-simple-podcasting' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, | |
| 351 | - 6 => sprintf( __( 'Episode published. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ), | |
| 352 | - 7 => __( 'Episode saved.' , 'seriously-simple-podcasting' ), | |
| 353 | - 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>' ), | |
| 354 | - 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>' ), | |
| 355 | - 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>' ), | |
| 345 | + 0 => '', | |
| 346 | + 1 => sprintf( __( 'Episode updated. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ), | |
| 347 | + 2 => __( 'Custom field updated.' , 'seriously-simple-podcasting' ), | |
| 348 | + 3 => __( 'Custom field deleted.' , 'seriously-simple-podcasting' ), | |
| 349 | + 4 => __( 'Episode updated.' , 'seriously-simple-podcasting' ), | |
| 350 | + 5 => isset($_GET['revision']) ? sprintf( __( 'Episode restored to revision from %s.' , 'seriously-simple-podcasting' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, | |
| 351 | + 6 => sprintf( __( 'Episode published. %sView episode%s.' , 'seriously-simple-podcasting' ), '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ), | |
| 352 | + 7 => __( 'Episode saved.' , 'seriously-simple-podcasting' ), | |
| 353 | + 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>' ), | |
| 354 | + 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>' ), | |
| 355 | + 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>' ), | |
| 356 | 356 | ); | 
| 357 | 357 | |
| 358 | 358 | return $messages; | 
| @@ -611,60 +611,60 @@ discard block | ||
| 611 | 611 | |
| 612 | 612 | $fields['episode_type'] = array( | 
| 613 | 613 | 'name' => __( 'Episode type:' , 'seriously-simple-podcasting' ), | 
| 614 | - 'description' => '', | |
| 615 | - 'type' => 'radio', | |
| 616 | - 'default' => 'audio', | |
| 617 | - 'options' => array( 'audio' => __( 'Audio', 'seriously-simple-podcasting' ), 'video' => __( 'Video', 'seriously-simple-podcasting' ) ), | |
| 618 | - 'section' => 'info', | |
| 614 | + 'description' => '', | |
| 615 | + 'type' => 'radio', | |
| 616 | + 'default' => 'audio', | |
| 617 | + 'options' => array( 'audio' => __( 'Audio', 'seriously-simple-podcasting' ), 'video' => __( 'Video', 'seriously-simple-podcasting' ) ), | |
| 618 | + 'section' => 'info', | |
| 619 | 619 | ); | 
| 620 | 620 | |
| 621 | 621 | // 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 | 
| 622 | 622 | $fields['audio_file'] = array( | 
| 623 | - 'name' => __( 'Podcast file:' , 'seriously-simple-podcasting' ), | |
| 624 | - 'description' => __( 'Upload the primary podcast file or paste the file URL here.' , 'seriously-simple-podcasting' ), | |
| 625 | - 'type' => 'file', | |
| 626 | - 'default' => '', | |
| 627 | - 'section' => 'info', | |
| 623 | + 'name' => __( 'Podcast file:' , 'seriously-simple-podcasting' ), | |
| 624 | + 'description' => __( 'Upload the primary podcast file or paste the file URL here.' , 'seriously-simple-podcasting' ), | |
| 625 | + 'type' => 'file', | |
| 626 | + 'default' => '', | |
| 627 | + 'section' => 'info', | |
| 628 | 628 | ); | 
| 629 | 629 | |
| 630 | 630 | $fields['duration'] = array( | 
| 631 | - 'name' => __( 'Duration:' , 'seriously-simple-podcasting' ), | |
| 632 | - 'description' => __( 'Duration of podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ), | |
| 633 | - 'type' => 'text', | |
| 634 | - 'default' => '', | |
| 635 | - 'section' => 'info', | |
| 631 | + 'name' => __( 'Duration:' , 'seriously-simple-podcasting' ), | |
| 632 | + 'description' => __( 'Duration of podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ), | |
| 633 | + 'type' => 'text', | |
| 634 | + 'default' => '', | |
| 635 | + 'section' => 'info', | |
| 636 | 636 | ); | 
| 637 | 637 | |
| 638 | 638 | $fields['filesize'] = array( | 
| 639 | - 'name' => __( 'File size:' , 'seriously-simple-podcasting' ), | |
| 640 | - 'description' => __( 'Size of the podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ), | |
| 641 | - 'type' => 'text', | |
| 642 | - 'default' => '', | |
| 643 | - 'section' => 'info', | |
| 639 | + 'name' => __( 'File size:' , 'seriously-simple-podcasting' ), | |
| 640 | + 'description' => __( 'Size of the podcast file for display (calculated automatically if possible).' , 'seriously-simple-podcasting' ), | |
| 641 | + 'type' => 'text', | |
| 642 | + 'default' => '', | |
| 643 | + 'section' => 'info', | |
| 644 | 644 | ); | 
| 645 | 645 | |
| 646 | 646 | $fields['date_recorded'] = array( | 
| 647 | - 'name' => __( 'Date recorded:' , 'seriously-simple-podcasting' ), | |
| 648 | - 'description' => __( 'The date on which this episode was recorded.' , 'seriously-simple-podcasting' ), | |
| 649 | - 'type' => 'datepicker', | |
| 650 | - 'default' => '', | |
| 651 | - 'section' => 'info', | |
| 647 | + 'name' => __( 'Date recorded:' , 'seriously-simple-podcasting' ), | |
| 648 | + 'description' => __( 'The date on which this episode was recorded.' , 'seriously-simple-podcasting' ), | |
| 649 | + 'type' => 'datepicker', | |
| 650 | + 'default' => '', | |
| 651 | + 'section' => 'info', | |
| 652 | 652 | ); | 
| 653 | 653 | |
| 654 | 654 | $fields['explicit'] = array( | 
| 655 | - 'name' => __( 'Explicit:' , 'seriously-simple-podcasting' ), | |
| 656 | - 'description' => __( 'Mark this episode as explicit.' , 'seriously-simple-podcasting' ), | |
| 657 | - 'type' => 'checkbox', | |
| 658 | - 'default' => '', | |
| 659 | - 'section' => 'info', | |
| 655 | + 'name' => __( 'Explicit:' , 'seriously-simple-podcasting' ), | |
| 656 | + 'description' => __( 'Mark this episode as explicit.' , 'seriously-simple-podcasting' ), | |
| 657 | + 'type' => 'checkbox', | |
| 658 | + 'default' => '', | |
| 659 | + 'section' => 'info', | |
| 660 | 660 | ); | 
| 661 | 661 | |
| 662 | 662 | $fields['block'] = array( | 
| 663 | - 'name' => __( 'Block:' , 'seriously-simple-podcasting' ), | |
| 664 | - 'description' => __( 'Block this episode from appearing in the iTunes & Google Play podcast libraries.' , 'seriously-simple-podcasting' ), | |
| 665 | - 'type' => 'checkbox', | |
| 666 | - 'default' => '', | |
| 667 | - 'section' => 'info', | |
| 663 | + 'name' => __( 'Block:' , 'seriously-simple-podcasting' ), | |
| 664 | + 'description' => __( 'Block this episode from appearing in the iTunes & Google Play podcast libraries.' , 'seriously-simple-podcasting' ), | |
| 665 | + 'type' => 'checkbox', | |
| 666 | + 'default' => '', | |
| 667 | + 'section' => 'info', | |
| 668 | 668 | ); | 
| 669 | 669 | |
| 670 | 670 | return apply_filters( 'ssp_episode_fields', $fields ); | 
| @@ -770,20 +770,20 @@ discard block | ||
| 770 | 770 | * @return void | 
| 771 | 771 | */ | 
| 772 | 772 |  	public function load_plugin_textdomain() { | 
| 773 | - $domain = 'seriously-simple-podcasting'; | |
| 774 | - // The "plugin_locale" filter is also used in load_plugin_textdomain() | |
| 775 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); | |
| 773 | + $domain = 'seriously-simple-podcasting'; | |
| 774 | + // The "plugin_locale" filter is also used in load_plugin_textdomain() | |
| 775 | + $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); | |
| 776 | 776 | |
| 777 | - load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' ); | |
| 778 | - load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' ); | |
| 777 | + load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' ); | |
| 778 | + load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' ); | |
| 779 | 779 | } | 
| 780 | 780 | |
| 781 | - /** | |
| 782 | - * Register podcast feed | |
| 783 | - * @return void | |
| 784 | - */ | |
| 785 | -    public function add_feed() { | |
| 786 | - $feed_slug = apply_filters( 'ssp_feed_slug', $this->token ); | |
| 781 | + /** | |
| 782 | + * Register podcast feed | |
| 783 | + * @return void | |
| 784 | + */ | |
| 785 | +	public function add_feed() { | |
| 786 | + $feed_slug = apply_filters( 'ssp_feed_slug', $this->token ); | |
| 787 | 787 | add_feed( $feed_slug, array( $this, 'feed_template' ) ); | 
| 788 | 788 | } | 
| 789 | 789 | |
| @@ -805,31 +805,31 @@ discard block | ||
| 805 | 805 | * Load feed template | 
| 806 | 806 | * @return void | 
| 807 | 807 | */ | 
| 808 | -    public function feed_template() { | |
| 809 | - global $wp_query; | |
| 808 | +	public function feed_template() { | |
| 809 | + global $wp_query; | |
| 810 | 810 | |
| 811 | - // Prevent 404 on feed | |
| 812 | - $wp_query->is_404 = false; | |
| 813 | - status_header( 200 ); | |
| 811 | + // Prevent 404 on feed | |
| 812 | + $wp_query->is_404 = false; | |
| 813 | + status_header( 200 ); | |
| 814 | 814 | |
| 815 | - $file_name = 'feed-podcast.php'; | |
| 815 | + $file_name = 'feed-podcast.php'; | |
| 816 | 816 | |
| 817 | - $user_template_file = apply_filters( 'ssp_feed_template_file', trailingslashit( get_stylesheet_directory() ) . $file_name ); | |
| 817 | + $user_template_file = apply_filters( 'ssp_feed_template_file', trailingslashit( get_stylesheet_directory() ) . $file_name ); | |
| 818 | 818 | |
| 819 | 819 | // Any functions hooked in here must NOT output any data or else feed will break | 
| 820 | 820 | do_action( 'ssp_before_feed' ); | 
| 821 | 821 | |
| 822 | - // Load user feed template if it exists, otherwise use plugin template | |
| 823 | -    	if ( file_exists( $user_template_file ) ) { | |
| 824 | - require( $user_template_file ); | |
| 825 | -    	} else { | |
| 826 | - require( $this->template_path . $file_name ); | |
| 827 | - } | |
| 822 | + // Load user feed template if it exists, otherwise use plugin template | |
| 823 | +		if ( file_exists( $user_template_file ) ) { | |
| 824 | + require( $user_template_file ); | |
| 825 | +		} else { | |
| 826 | + require( $this->template_path . $file_name ); | |
| 827 | + } | |
| 828 | 828 | |
| 829 | - // Any functions hooked in here must NOT output any data or else feed will break | |
| 830 | - do_action( 'ssp_after_feed' ); | |
| 829 | + // Any functions hooked in here must NOT output any data or else feed will break | |
| 830 | + do_action( 'ssp_after_feed' ); | |
| 831 | 831 | |
| 832 | - exit; | |
| 832 | + exit; | |
| 833 | 833 | } | 
| 834 | 834 | |
| 835 | 835 | /** |