bp_document_get_attachment_urls( [type] $attachment_id )

Returns the attachment URL and sizes URLs, in case of an image

Description

Parameters

$attachment_id

([type]) (Required)

Return

(void)

Source

File: bp-document/bp-document-functions.php

function bp_document_get_attachment_urls( $attachment_id ) {
	$urls = array( wp_get_attachment_url( $attachment_id ) );
	if ( wp_attachment_is_image( $attachment_id ) ) {
		foreach ( get_intermediate_image_sizes() as $size ) {
			$image  = wp_get_attachment_image_src( $attachment_id, $size );
			$urls[] = $image[0];
		}
	}

	return array_unique( $urls );
}

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.