dozent_attachments( int $post_ID, bool $echo = true )

Get the attachments template by post ID.


Description

Get the attachments in HTML format from the Dozent LMS template directory The post ID could be lecture id, assignment id, quiz id

Example usage:

dozent_attachments();
dozent_attachments( $post_ID );
dozent_attachments( false ); //return the output instead if print directly

See also


Parameters

$post_ID

(int) (Required)

$echo

(bool) (Optional)

Default value: true


Return

(mixed|string|void)


Source

File: includes/template-functions.php

	function dozent_attachments( $post_ID = 0, $echo = true ) {
		$post_ID     = dozent_get_post_id( $post_ID );
		$attachments = dozent_get_attachments( $post_ID );

		$output = "";

		if ( dozent_count( $attachments ) ) {
			ob_start();
			dozent_load_template( 'global.attachments', compact( 'attachments' ) );
			$output = apply_filters( 'dozent.global.attachments', ob_get_clean(), $post_ID );
		}

		if ( $echo ) {
			echo $output;
		}

		return $output;
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.