bp_document_get_preview_audio_url( $document_id,  $extension,  $attachment_id )

Return the audio url of the file.

Description

Parameters

$document_id

(Required)

$extension

(Required)

$attachment_id

(Required)

Return

(mixed|void)

Source

File: bp-templates/bp-nouveau/includes/document/functions.php

1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
function bp_document_get_preview_audio_url( $document_id, $extension, $attachment_id ) {
    $attachment_url = '';
 
    if ( in_array( $extension, bp_get_document_preview_music_extensions(), true ) ) {
        $passed_attachment_id   = $attachment_id;
        $document_id            = 'forbidden_' . $document_id;
        $attachment_id          = 'forbidden_' . $attachment_id;
        $output_file_src         = get_attached_file( $passed_attachment_id );
        if ( ! empty( $attachment_id ) && ! empty( $document_id ) && file_exists( $output_file_src) ) {
            $attachment_url     = trailingslashit( buddypress()->plugin_url ) . 'bp-templates/bp-nouveau/includes/document/player.php?id=' . base64_encode( $attachment_id ) . '&id1=' . base64_encode( $document_id );
        }
    }
 
    return apply_filters( 'bp_document_get_preview_image_url', $attachment_url, $document_id, $extension );
}

Changelog

Changelog
Version Description
BuddyBoss 1.4.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.