Changeset 27785 for trunk/src/wp-includes/media.php
- Timestamp:
- 03/27/2014 05:57:30 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/media.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r27735 r27785 1073 1073 * 1074 1074 * @param array $attr Attributes of the shortcode. 1075 * @param string $type Type of playlist. Accepts 'audio' and 'video'.1076 1075 * @return string Playlist output. Empty string if the passed type is unsupported. 1077 1076 */ 1078 function wp_ get_playlist( $attr, $type) {1077 function wp_playlist_shortcode( $attr ) { 1079 1078 global $content_width; 1080 1079 $post = get_post(); 1081 1082 if ( ! in_array( $type, array( 'audio', 'video' ) ) ) {1083 return '';1084 }1085 1080 1086 1081 static $instance = 0; … … 1107 1102 * @param string $type Type of playlist to generate output for. 1108 1103 */ 1109 $output = apply_filters( 'post_playlist', '', $attr , $type);1104 $output = apply_filters( 'post_playlist', '', $attr ); 1110 1105 if ( $output != '' ) { 1111 1106 return $output; … … 1123 1118 1124 1119 extract( shortcode_atts( array( 1120 'type' => 'audio', 1125 1121 'order' => 'ASC', 1126 1122 'orderby' => 'menu_order ID', … … 1129 1125 'exclude' => '', 1130 1126 'style' => 'light', 1131 'tracklist' => 'audio' === $type,1132 'tracknumbers' => 'audio' === $type,1127 'tracklist' => true, 1128 'tracknumbers' => true, 1133 1129 'images' => true, 1134 1130 'artists' => true … … 1138 1134 if ( 'RAND' == $order ) { 1139 1135 $orderby = 'none'; 1140 }1141 1142 $playlist_styles = array(1143 'light' => _x( 'Light', 'playlist theme' ),1144 'dark' => _x( 'Dark', 'playlist theme' )1145 );1146 1147 /**1148 * Filter the available playlist styles.1149 *1150 * @since 3.9.01151 *1152 * @param array $playlist_styles Array of playlist styles. Defaults are 'light' and 'dark'.1153 */1154 $styles = apply_filters( 'playlist_styles', $playlist_styles );1155 1156 if ( ! in_array( $style, array_keys( $styles ), true ) ) {1157 $style = 'light';1158 1136 } 1159 1137 … … 1203 1181 $theme_height = empty( $content_width ) ? $default_height : round( ( $default_height * $theme_width ) / $default_width ); 1204 1182 1205 $data = compact( 'type' , 'style');1183 $data = compact( 'type' ); 1206 1184 1207 1185 // don't pass strings to JSON, will be truthy in JS … … 1312 1290 return ob_get_clean(); 1313 1291 } 1314 1315 /**1316 * Playlist shortcode handler1317 *1318 * @since 3.9.01319 *1320 * @param array $attr Parsed shortcode attributes.1321 * @return string The resolved playlist shortcode markup.1322 */1323 function wp_playlist_shortcode( $attr ) {1324 return wp_get_playlist( $attr, 'audio' );1325 }1326 1292 add_shortcode( 'playlist', 'wp_playlist_shortcode' ); 1327 1328 /**1329 * Video playlist shortcode handler1330 *1331 * @since 3.9.01332 *1333 * @param array $attr Parsed shortcode attributes.1334 * @return string The resolved video playlist shortcode markup.1335 */1336 function wp_video_playlist_shortcode( $attr ) {1337 return wp_get_playlist( $attr, 'video' );1338 }1339 add_shortcode( 'video-playlist', 'wp_video_playlist_shortcode' );1340 1293 1341 1294 /**
Note: See TracChangeset
for help on using the changeset viewer.