@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly. |
3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
3 | +if ( ! defined ( 'ABSPATH' ) ) { |
|
4 | 4 | exit; |
5 | 5 | } |
6 | 6 | |
@@ -26,19 +26,19 @@ discard block |
||
26 | 26 | $instance++; |
27 | 27 | |
28 | 28 | // Get all podcast post types |
29 | - $podcast_post_types = ssp_post_types( true ); |
|
29 | + $podcast_post_types = ssp_post_types ( true ); |
|
30 | 30 | |
31 | 31 | // Get list of episode IDs for display from `episodes` parameter |
32 | - if ( ! empty( $params['episodes'] ) ) { |
|
32 | + if ( ! empty( $params[ 'episodes' ] ) ) { |
|
33 | 33 | // 'episodes' is explicitly ordered, unless you specify otherwise. |
34 | - if ( empty( $params['orderby'] ) ) { |
|
35 | - $params['orderby'] = 'post__in'; |
|
34 | + if ( empty( $params[ 'orderby' ] ) ) { |
|
35 | + $params[ 'orderby' ] = 'post__in'; |
|
36 | 36 | } |
37 | - $params['include'] = $params['episodes']; |
|
37 | + $params[ 'include' ] = $params[ 'episodes' ]; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | // Parse shortcode attributes |
41 | - $atts = shortcode_atts( array( |
|
41 | + $atts = shortcode_atts ( array( |
|
42 | 42 | 'type' => 'audio', |
43 | 43 | 'series' => '', |
44 | 44 | 'order' => 'ASC', |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | ), $params, 'podcast_playlist' ); |
53 | 53 | |
54 | 54 | // Included posts must be passed as an array |
55 | - if( $atts['include'] ) { |
|
56 | - $atts['include'] = explode( ',', $atts['include'] ); |
|
55 | + if ( $atts[ 'include' ] ) { |
|
56 | + $atts[ 'include' ] = explode ( ',', $atts[ 'include' ] ); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // Excluded posts must be passed as an array |
60 | - if( $atts['exclude'] ) { |
|
61 | - $atts['exclude'] = explode( ',', $atts['exclude'] ); |
|
60 | + if ( $atts[ 'exclude' ] ) { |
|
61 | + $atts[ 'exclude' ] = explode ( ',', $atts[ 'exclude' ] ); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // Set up query rguments for fetching podcast episodes |
@@ -66,33 +66,33 @@ discard block |
||
66 | 66 | 'post_status' => 'publish', |
67 | 67 | 'post_type' => $podcast_post_types, |
68 | 68 | 'posts_per_page' => -1, |
69 | - 'order' => $atts['order'], |
|
70 | - 'orderby' => $atts['orderby'], |
|
69 | + 'order' => $atts[ 'order' ], |
|
70 | + 'orderby' => $atts[ 'orderby' ], |
|
71 | 71 | 'ignore_sticky_posts' => true, |
72 | - 'post__in' => $atts['include'], |
|
73 | - 'post__not_in' => $atts['exclude'], |
|
72 | + 'post__in' => $atts[ 'include' ], |
|
73 | + 'post__not_in' => $atts[ 'exclude' ], |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | // Limit query to episodes in defined series only |
77 | - if ( $atts['series'] ) { |
|
77 | + if ( $atts[ 'series' ] ) { |
|
78 | 78 | |
79 | - $query_args['tax_query'] = array( |
|
79 | + $query_args[ 'tax_query' ] = array( |
|
80 | 80 | array( |
81 | 81 | 'taxonomy' => 'series', |
82 | 82 | 'field' => 'slug', |
83 | - 'terms' => $atts['series'], |
|
83 | + 'terms' => $atts[ 'series' ], |
|
84 | 84 | ), |
85 | 85 | ); |
86 | 86 | |
87 | 87 | } |
88 | 88 | |
89 | 89 | // Allow dynamic filtering of query args |
90 | - $query_args = apply_filters( 'ssp_podcast_playlist_query_args', $query_args ); |
|
90 | + $query_args = apply_filters ( 'ssp_podcast_playlist_query_args', $query_args ); |
|
91 | 91 | |
92 | 92 | // Fetch all episodes for display |
93 | - $episodes = get_posts( $query_args ); |
|
93 | + $episodes = get_posts ( $query_args ); |
|
94 | 94 | |
95 | - if( empty ( $episodes ) ) { |
|
95 | + if ( empty ( $episodes ) ) { |
|
96 | 96 | return; |
97 | 97 | } |
98 | 98 | |
@@ -102,30 +102,30 @@ discard block |
||
102 | 102 | $default_height = 360; |
103 | 103 | |
104 | 104 | $theme_width = empty( $content_width ) ? $default_width : ( $content_width - $outer ); |
105 | - $theme_height = empty( $content_width ) ? $default_height : round( ( $default_height * $theme_width ) / $default_width ); |
|
105 | + $theme_height = empty( $content_width ) ? $default_height : round ( ( $default_height * $theme_width ) / $default_width ); |
|
106 | 106 | |
107 | 107 | $data = array( |
108 | - 'type' => $atts['type'], |
|
108 | + 'type' => $atts[ 'type' ], |
|
109 | 109 | // don't pass strings to JSON, will be truthy in JS |
110 | - 'tracklist' => wp_validate_boolean( $atts['tracklist'] ), |
|
111 | - 'tracknumbers' => wp_validate_boolean( $atts['tracknumbers'] ), |
|
112 | - 'images' => wp_validate_boolean( $atts['images'] ), |
|
110 | + 'tracklist' => wp_validate_boolean ( $atts[ 'tracklist' ] ), |
|
111 | + 'tracknumbers' => wp_validate_boolean ( $atts[ 'tracknumbers' ] ), |
|
112 | + 'images' => wp_validate_boolean ( $atts[ 'images' ] ), |
|
113 | 113 | 'artists' => false, |
114 | 114 | ); |
115 | 115 | |
116 | 116 | $tracks = array(); |
117 | 117 | foreach ( $episodes as $episode ) { |
118 | 118 | |
119 | - $url = $ss_podcasting->get_enclosure( $episode->ID ); |
|
120 | - if ( get_option( 'permalink_structure' ) ) { |
|
121 | - $url = $ss_podcasting->get_episode_download_link( $episode->ID ); |
|
122 | - $url = str_replace( 'podcast-download', 'podcast-player', $url ); |
|
119 | + $url = $ss_podcasting->get_enclosure ( $episode->ID ); |
|
120 | + if ( get_option ( 'permalink_structure' ) ) { |
|
121 | + $url = $ss_podcasting->get_episode_download_link ( $episode->ID ); |
|
122 | + $url = str_replace ( 'podcast-download', 'podcast-player', $url ); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | // Get episode file type |
126 | - $ftype = wp_check_filetype( $url, wp_get_mime_types() ); |
|
126 | + $ftype = wp_check_filetype ( $url, wp_get_mime_types () ); |
|
127 | 127 | |
128 | - if( $episode->post_excerpt ) { |
|
128 | + if ( $episode->post_excerpt ) { |
|
129 | 129 | $episode_excerpt = $episode->post_excerpt; |
130 | 130 | } else { |
131 | 131 | $episode_excerpt = $episode->post_title; |
@@ -134,19 +134,19 @@ discard block |
||
134 | 134 | // Setup episode data for media player |
135 | 135 | $track = array( |
136 | 136 | 'src' => $url, |
137 | - 'type' => $ftype['type'], |
|
137 | + 'type' => $ftype[ 'type' ], |
|
138 | 138 | 'caption' => $episode->post_title, |
139 | 139 | 'title' => $episode_excerpt, |
140 | 140 | 'description' => $episode->post_content, |
141 | 141 | ); |
142 | 142 | |
143 | 143 | // We don't need the ID3 meta data here, but still need to set an empty array |
144 | - $track['meta'] = array(); |
|
144 | + $track[ 'meta' ] = array(); |
|
145 | 145 | |
146 | 146 | // Set video dimensions for player |
147 | - if ( 'video' === $atts['type'] ) { |
|
148 | - $track['dimensions'] = array( |
|
149 | - 'original' => compact( $default_width, $default_height ), |
|
147 | + if ( 'video' === $atts[ 'type' ] ) { |
|
148 | + $track[ 'dimensions' ] = array( |
|
149 | + 'original' => compact ( $default_width, $default_height ), |
|
150 | 150 | 'resized' => array( |
151 | 151 | 'width' => $theme_width, |
152 | 152 | 'height' => $theme_height |
@@ -155,27 +155,27 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | // Get episode image |
158 | - if ( $atts['images'] ) { |
|
159 | - $thumb_id = get_post_thumbnail_id( $episode->ID ); |
|
158 | + if ( $atts[ 'images' ] ) { |
|
159 | + $thumb_id = get_post_thumbnail_id ( $episode->ID ); |
|
160 | 160 | if ( ! empty( $thumb_id ) ) { |
161 | - list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'full' ); |
|
162 | - $track['image'] = compact( 'src', 'width', 'height' ); |
|
163 | - list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'thumbnail' ); |
|
164 | - $track['thumb'] = compact( 'src', 'width', 'height' ); |
|
161 | + list( $src, $width, $height ) = wp_get_attachment_image_src ( $thumb_id, 'full' ); |
|
162 | + $track[ 'image' ] = compact ( 'src', 'width', 'height' ); |
|
163 | + list( $src, $width, $height ) = wp_get_attachment_image_src ( $thumb_id, 'thumbnail' ); |
|
164 | + $track[ 'thumb' ] = compact ( 'src', 'width', 'height' ); |
|
165 | 165 | } else { |
166 | - $track['image'] = ''; |
|
167 | - $track['thumb'] = ''; |
|
166 | + $track[ 'image' ] = ''; |
|
167 | + $track[ 'thumb' ] = ''; |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
171 | - $tracks[] = $track; |
|
171 | + $tracks[ ] = $track; |
|
172 | 172 | } |
173 | - $data['tracks'] = $tracks; |
|
173 | + $data[ 'tracks' ] = $tracks; |
|
174 | 174 | |
175 | - $safe_type = esc_attr( $atts['type'] ); |
|
176 | - $safe_style = esc_attr( $atts['style'] ); |
|
175 | + $safe_type = esc_attr ( $atts[ 'type' ] ); |
|
176 | + $safe_style = esc_attr ( $atts[ 'style' ] ); |
|
177 | 177 | |
178 | - ob_start(); |
|
178 | + ob_start (); |
|
179 | 179 | |
180 | 180 | if ( 1 === $instance ) { |
181 | 181 | /** |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | * @param string $type Type of playlist. Possible values are 'audio' or 'video'. |
187 | 187 | * @param string $style The 'theme' for the playlist. Core provides 'light' and 'dark'. |
188 | 188 | */ |
189 | - do_action( 'wp_playlist_scripts', $atts['type'], $atts['style'] ); |
|
189 | + do_action ( 'wp_playlist_scripts', $atts[ 'type' ], $atts[ 'style' ] ); |
|
190 | 190 | } ?> |
191 | 191 | <div class="wp-playlist wp-<?php echo $safe_type ?>-playlist wp-playlist-<?php echo $safe_style ?>"> |
192 | - <?php if ( 'audio' === $atts['type'] ): ?> |
|
192 | + <?php if ( 'audio' === $atts[ 'type' ] ): ?> |
|
193 | 193 | <div class="wp-playlist-current-item"></div> |
194 | 194 | <?php endif ?> |
195 | 195 | <<?php echo $safe_type ?> controls="controls" preload="none" width="<?php |
@@ -202,21 +202,21 @@ discard block |
||
202 | 202 | <noscript> |
203 | 203 | <ol><?php |
204 | 204 | foreach ( $episodes as $episode ) { |
205 | - $url = $ss_podcasting->get_enclosure( $episode->ID ); |
|
206 | - if ( get_option( 'permalink_structure' ) ) { |
|
207 | - $url = $ss_podcasting->get_episode_download_link( $episode->ID ); |
|
208 | - $url = str_replace( 'podcast-download', 'podcast-player', $url ); |
|
205 | + $url = $ss_podcasting->get_enclosure ( $episode->ID ); |
|
206 | + if ( get_option ( 'permalink_structure' ) ) { |
|
207 | + $url = $ss_podcasting->get_episode_download_link ( $episode->ID ); |
|
208 | + $url = str_replace ( 'podcast-download', 'podcast-player', $url ); |
|
209 | 209 | } |
210 | - printf( '<li>%s</li>', $url ); |
|
210 | + printf ( '<li>%s</li>', $url ); |
|
211 | 211 | } |
212 | 212 | ?></ol> |
213 | 213 | </noscript> |
214 | - <script type="application/json" class="wp-playlist-script"><?php echo wp_json_encode( $data ) ?></script> |
|
214 | + <script type="application/json" class="wp-playlist-script"><?php echo wp_json_encode ( $data ) ?></script> |
|
215 | 215 | </div> |
216 | 216 | <?php |
217 | - return ob_get_clean(); |
|
217 | + return ob_get_clean (); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | } |
221 | 221 | |
222 | -$GLOBALS['ssp_shortcodes']['podcast_playlist'] = new SSP_Shortcode_Podcast_Playlist(); |
|
223 | 222 | \ No newline at end of file |
223 | +$GLOBALS[ 'ssp_shortcodes' ][ 'podcast_playlist' ] = new SSP_Shortcode_Podcast_Playlist (); |
|
224 | 224 | \ No newline at end of file |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Exit if accessed directly. |
4 | -if ( ! defined( 'ABSPATH' ) ) { |
|
4 | +if ( ! defined ( 'ABSPATH' ) ) { |
|
5 | 5 | exit; |
6 | 6 | } |
7 | 7 | |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | public function __construct() { |
27 | 27 | // Widget variable settings |
28 | 28 | $this->widget_cssclass = 'widget_podcast_playlist'; |
29 | - $this->widget_description = __( 'Display a playlist of episodes.', 'seriously-simple-podcasting' ); |
|
29 | + $this->widget_description = __ ( 'Display a playlist of episodes.', 'seriously-simple-podcasting' ); |
|
30 | 30 | $this->widget_idbase = 'ss_podcast'; |
31 | - $this->widget_title = __( 'Podcast: Playlist', 'seriously-simple-podcasting' ); |
|
31 | + $this->widget_title = __ ( 'Podcast: Playlist', 'seriously-simple-podcasting' ); |
|
32 | 32 | |
33 | 33 | // Widget settings |
34 | 34 | $widget_ops = array( |
@@ -37,109 +37,109 @@ discard block |
||
37 | 37 | 'customize_selective_refresh' => true, |
38 | 38 | ); |
39 | 39 | |
40 | - parent::__construct('podcast-playlist', $this->widget_title, $widget_ops); |
|
40 | + parent::__construct ( 'podcast-playlist', $this->widget_title, $widget_ops ); |
|
41 | 41 | |
42 | 42 | $this->alt_option_name = 'widget_podcast_playlist'; |
43 | 43 | |
44 | - add_action( 'save_post', array( $this, 'flush_widget_cache' ) ); |
|
45 | - add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) ); |
|
46 | - add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) ); |
|
44 | + add_action ( 'save_post', array( $this, 'flush_widget_cache' ) ); |
|
45 | + add_action ( 'deleted_post', array( $this, 'flush_widget_cache' ) ); |
|
46 | + add_action ( 'switch_theme', array( $this, 'flush_widget_cache' ) ); |
|
47 | 47 | |
48 | 48 | } // End __construct() |
49 | 49 | |
50 | - public function widget($args, $instance) { |
|
50 | + public function widget( $args, $instance ) { |
|
51 | 51 | $cache = array(); |
52 | - if ( ! $this->is_preview() ) { |
|
53 | - $cache = wp_cache_get( 'widget_podcast_playlist', 'widget' ); |
|
52 | + if ( ! $this->is_preview () ) { |
|
53 | + $cache = wp_cache_get ( 'widget_podcast_playlist', 'widget' ); |
|
54 | 54 | } |
55 | 55 | |
56 | - if ( ! is_array( $cache ) ) { |
|
56 | + if ( ! is_array ( $cache ) ) { |
|
57 | 57 | $cache = array(); |
58 | 58 | } |
59 | 59 | |
60 | - if ( ! isset( $args['widget_id'] ) ) { |
|
61 | - $args['widget_id'] = $this->id; |
|
60 | + if ( ! isset( $args[ 'widget_id' ] ) ) { |
|
61 | + $args[ 'widget_id' ] = $this->id; |
|
62 | 62 | } |
63 | 63 | |
64 | - if ( isset( $cache[ $args['widget_id'] ] ) ) { |
|
65 | - echo $cache[ $args['widget_id'] ]; |
|
64 | + if ( isset( $cache[ $args[ 'widget_id' ] ] ) ) { |
|
65 | + echo $cache[ $args[ 'widget_id' ] ]; |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
69 | - ob_start(); |
|
69 | + ob_start (); |
|
70 | 70 | |
71 | - $episodes = ( $instance['episodes'] ) ? $instance['episodes'] : ''; |
|
72 | - $series_slug = ( $instance['series_slug'] ) ? $instance['series_slug'] : ''; |
|
71 | + $episodes = ( $instance[ 'episodes' ] ) ? $instance[ 'episodes' ] : ''; |
|
72 | + $series_slug = ( $instance[ 'series_slug' ] ) ? $instance[ 'series_slug' ] : ''; |
|
73 | 73 | |
74 | 74 | $shortcode = '[podcast_playlist'; |
75 | 75 | |
76 | - if( $episodes ) { |
|
77 | - $shortcode .= ' episodes=' . $episodes; |
|
76 | + if ( $episodes ) { |
|
77 | + $shortcode .= ' episodes='.$episodes; |
|
78 | 78 | } |
79 | 79 | |
80 | - if( $series_slug ) { |
|
81 | - $shortcode .= ' series=' . $series_slug; |
|
80 | + if ( $series_slug ) { |
|
81 | + $shortcode .= ' series='.$series_slug; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | $shortcode .= ']'; |
85 | 85 | |
86 | - $title = $instance['title']; |
|
86 | + $title = $instance[ 'title' ]; |
|
87 | 87 | |
88 | 88 | /** This filter is documented in wp-includes/default-widgets.php */ |
89 | - $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); |
|
89 | + $title = apply_filters ( 'widget_title', $title, $instance, $this->id_base ); |
|
90 | 90 | |
91 | - echo $args['before_widget']; |
|
91 | + echo $args[ 'before_widget' ]; |
|
92 | 92 | |
93 | 93 | if ( $title ) { |
94 | - echo $args['before_title'] . $title . $args['after_title']; |
|
94 | + echo $args[ 'before_title' ].$title.$args[ 'after_title' ]; |
|
95 | 95 | } |
96 | 96 | |
97 | - echo do_shortcode( $shortcode ); |
|
97 | + echo do_shortcode ( $shortcode ); |
|
98 | 98 | |
99 | - echo $args['after_widget']; |
|
99 | + echo $args[ 'after_widget' ]; |
|
100 | 100 | |
101 | - if ( ! $this->is_preview() ) { |
|
102 | - $cache[ $args['widget_id'] ] = ob_get_flush(); |
|
103 | - wp_cache_set( 'widget_podcast_series', $cache, 'widget' ); |
|
101 | + if ( ! $this->is_preview () ) { |
|
102 | + $cache[ $args[ 'widget_id' ] ] = ob_get_flush (); |
|
103 | + wp_cache_set ( 'widget_podcast_series', $cache, 'widget' ); |
|
104 | 104 | } else { |
105 | - ob_end_flush(); |
|
105 | + ob_end_flush (); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
109 | 109 | public function update( $new_instance, $old_instance ) { |
110 | 110 | $instance = $old_instance; |
111 | - $instance['title'] = strip_tags( $new_instance['title'] ); |
|
112 | - $instance['episodes'] = isset( $new_instance['episodes'] ) ? $new_instance['episodes'] : ''; |
|
113 | - $instance['series_slug'] = isset( $new_instance['series_slug'] ) ? $new_instance['series_slug'] : ''; |
|
114 | - $this->flush_widget_cache(); |
|
111 | + $instance[ 'title' ] = strip_tags ( $new_instance[ 'title' ] ); |
|
112 | + $instance[ 'episodes' ] = isset( $new_instance[ 'episodes' ] ) ? $new_instance[ 'episodes' ] : ''; |
|
113 | + $instance[ 'series_slug' ] = isset( $new_instance[ 'series_slug' ] ) ? $new_instance[ 'series_slug' ] : ''; |
|
114 | + $this->flush_widget_cache (); |
|
115 | 115 | |
116 | 116 | return $instance; |
117 | 117 | } |
118 | 118 | |
119 | 119 | public function flush_widget_cache() { |
120 | - wp_cache_delete('widget_podcast_playlist', 'widget'); |
|
120 | + wp_cache_delete ( 'widget_podcast_playlist', 'widget' ); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | public function form( $instance ) { |
124 | - $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; |
|
125 | - $episodes = isset( $instance['episodes'] ) ? esc_attr( $instance['episodes'] ) : ''; |
|
126 | - $series_slug = isset( $instance['series_slug'] ) ? $instance['series_slug'] : ''; |
|
124 | + $title = isset( $instance[ 'title' ] ) ? esc_attr ( $instance[ 'title' ] ) : ''; |
|
125 | + $episodes = isset( $instance[ 'episodes' ] ) ? esc_attr ( $instance[ 'episodes' ] ) : ''; |
|
126 | + $series_slug = isset( $instance[ 'series_slug' ] ) ? $instance[ 'series_slug' ] : ''; |
|
127 | 127 | |
128 | 128 | // Get all podcast series |
129 | - $series = get_terms( 'series' ); |
|
129 | + $series = get_terms ( 'series' ); |
|
130 | 130 | ?> |
131 | - <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title (optional):', 'seriously-simple-podcasting' ); ?></label> |
|
132 | - <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" placeholder="<?php _e( 'Widget title', 'seriously-simple-podcasting' ); ?>" value="<?php echo $title; ?>" /></p> |
|
131 | + <p><label for="<?php echo $this->get_field_id ( 'title' ); ?>"><?php _e ( 'Title (optional):', 'seriously-simple-podcasting' ); ?></label> |
|
132 | + <input class="widefat" id="<?php echo $this->get_field_id ( 'title' ); ?>" name="<?php echo $this->get_field_name ( 'title' ); ?>" type="text" placeholder="<?php _e ( 'Widget title', 'seriously-simple-podcasting' ); ?>" value="<?php echo $title; ?>" /></p> |
|
133 | 133 | |
134 | - <p><label for="<?php echo $this->get_field_id( 'episodes' ); ?>"><?php _e( 'Episodes (comma-separated IDs):', 'seriously-simple-podcasting' ); ?></label> |
|
135 | - <input class="widefat" id="<?php echo $this->get_field_id( 'episodes' ); ?>" name="<?php echo $this->get_field_name( 'episodes' ); ?>" type="text" placeholder="<?php _e( 'Display all episodes', 'seriously-simple-podcasting' ); ?>" value="<?php echo $episodes; ?>" /></p> |
|
134 | + <p><label for="<?php echo $this->get_field_id ( 'episodes' ); ?>"><?php _e ( 'Episodes (comma-separated IDs):', 'seriously-simple-podcasting' ); ?></label> |
|
135 | + <input class="widefat" id="<?php echo $this->get_field_id ( 'episodes' ); ?>" name="<?php echo $this->get_field_name ( 'episodes' ); ?>" type="text" placeholder="<?php _e ( 'Display all episodes', 'seriously-simple-podcasting' ); ?>" value="<?php echo $episodes; ?>" /></p> |
|
136 | 136 | |
137 | - <p><label for="<?php echo $this->get_field_id( 'series_slug' ); ?>"><?php _e( 'Series:', 'seriously-simple-podcasting' ); ?></label> |
|
138 | - <select id="<?php echo $this->get_field_id( 'series_slug' ); ?>" name="<?php echo $this->get_field_name( 'series_slug' ); ?>"> |
|
139 | - <option value=""><?php _e( 'Use episodes specified above', 'seriously-simple-podcasting' ); ?></option> |
|
137 | + <p><label for="<?php echo $this->get_field_id ( 'series_slug' ); ?>"><?php _e ( 'Series:', 'seriously-simple-podcasting' ); ?></label> |
|
138 | + <select id="<?php echo $this->get_field_id ( 'series_slug' ); ?>" name="<?php echo $this->get_field_name ( 'series_slug' ); ?>"> |
|
139 | + <option value=""><?php _e ( 'Use episodes specified above', 'seriously-simple-podcasting' ); ?></option> |
|
140 | 140 | <?php |
141 | 141 | foreach ( $series as $s ) { |
142 | - echo '<option value="' . esc_attr( $s->slug ) . '" ' . selected( $series_slug, $s->slug, false ) . '>' . $s->name . '</option>' . "\n"; |
|
142 | + echo '<option value="'.esc_attr ( $s->slug ).'" '.selected ( $series_slug, $s->slug, false ).'>'.$s->name.'</option>'."\n"; |
|
143 | 143 | } |
144 | 144 | ?> |
145 | 145 | </select> |
@@ -13,7 +13,7 @@ discard block |
||
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 |
||
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 |