Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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

    Kevin, thanks for this plugin. Currently I need this plugin to support multisite at a very basic level. It should be network activated and when ever I insert the media, full path should be taken since I am using network shared media plugin along with this. Hope this helps you.

Viewing 2 replies - 1 through 2 (of 2 total)