X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f..874d2a2f468a0d1e69aab49b1fe2d9d79d3e1142:/wp-includes/media.php?ds=sidebyside diff --git a/wp-includes/media.php b/wp-includes/media.php index b49e324f..5e94cfeb 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1247,6 +1247,10 @@ function wp_playlist_shortcode( $attr ) { $atts['orderby'] = 'none'; } + if ( $atts['type'] !== 'audio' ) { + $atts['type'] = 'video'; + } + $args = array( 'post_status' => 'inherit', 'post_type' => 'attachment', @@ -1596,8 +1600,8 @@ function wp_audio_shortcode( $attr, $content = '' ) { $html_atts = array( 'class' => apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ), 'id' => sprintf( 'audio-%d-%d', $post_id, $instances ), - 'loop' => $atts['loop'], - 'autoplay' => $atts['autoplay'], + 'loop' => wp_validate_boolean( $atts['loop'] ), + 'autoplay' => wp_validate_boolean( $atts['autoplay'] ), 'preload' => $atts['preload'], 'style' => 'width: 100%; visibility: hidden;', ); @@ -1822,8 +1826,8 @@ function wp_video_shortcode( $attr, $content = '' ) { 'width' => absint( $atts['width'] ), 'height' => absint( $atts['height'] ), 'poster' => esc_url( $atts['poster'] ), - 'loop' => $atts['loop'], - 'autoplay' => $atts['autoplay'], + 'loop' => wp_validate_boolean( $atts['loop'] ), + 'autoplay' => wp_validate_boolean( $atts['autoplay'] ), 'preload' => $atts['preload'], ); @@ -2643,6 +2647,11 @@ function wp_prepare_attachment_for_js( $attachment ) { if ( $attachment->post_parent ) { $post_parent = get_post( $attachment->post_parent ); + } else { + $post_parent = false; + } + + if ( $post_parent ) { $parent_type = get_post_type_object( $post_parent->post_type ); if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $attachment->post_parent ) ) { $response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' );