LLMS_Blocks_Course_Progress_Block::output( array $attributes = array() )

Output the course progress bar


Parameters Parameters

$attributes

(array) (Optional) Block attributes.

Default value: array()


Top ↑

Return Return

(void)


Top ↑

Source Source

File: libraries/lifterlms-blocks/includes/blocks/class-llms-blocks-course-progress-block.php

	public function output( $attributes = array() ) {

		$block_content = '';
		$progress      = do_shortcode( '[lifterlms_course_progress check_enrollment=1]' );
		$class         = empty( $attributes['className'] ) ? '' : $attributes['className'];

		if ( $progress ) {
			$block_content = sprintf(
				'<div class="wp-block-%1$s-%2$s%3$s">%4$s</div>',
				$this->vendor,
				$this->id,
				// Take into account the custom class attribute.
				empty( $attributes['className'] ) ? '' : ' ' . esc_attr( $attributes['className'] ),
				$progress
			);
		}

		/**
		 * Filters the block html
		 *
		 * @since 1.9.0
		 *
		 * @param string                            $block_content The block's html.
		 * @param array                             $attributes    The block's array of attributes.
		 * @param LLMS_Blocks_Course_Progress_Block $block         This block object.
		 */
		$block_content = apply_filters( 'llms_blocks_render_course_progress_block', $block_content, $attributes, $this );

		if ( $block_content ) {
			echo $block_content;
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.