Hi gksr,
I’ve not tested the plugin with video’s and I’m not quite sure how WordPress handles this.
Are you using a plugin to generate the video shortcode or is it default WordPress behavior?
Thread Starter
gksr
(@gksr)
I think its default wordpress behavior.
but I fixed it using the below code…
// fix for add video in network shared media - start
$post = get_post($attachment_id);
if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {
$align = isset( $attachment['align'] ) ? $attachment['align'] : 'none';
$size = isset( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium';
$alt = isset( $attachment['image_alt'] ) ? $attachment['image_alt'] : '';
$caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : '';
$title = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
$html = get_image_send_to_editor( $attachment_id, $caption, $title, $align, $url, (bool) $rel, $size, $alt );
} elseif ( 'video' === substr( $post->post_mime_type, 0, 5 ) ) {
$exploded_vidType = explode("-", $post->post_mime_type);
if (sizeof($exploded_vidType) == 1) {
$exploded_vidType = explode("/", $post->post_mime_type);
}
$html = '[video width="450" height="360" '.$exploded_vidType[1].'="' . $attachment['url'] . '"][/video]';
} elseif ( 'audio' === substr( $post->post_mime_type, 0, 5 ) ) {
$html = '[audio mp3="' . $attachment['url'] . '"][/audio]';
}
// fix for add video in network shared media - end
Hi gksr,
The new 0.10.0 supports video and audio (in a different way).