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

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.