dozent_expand_wrap( null $content = null, array $wrap_class = array(), bool $echo = true )

Wrap the content with expandable area


Description

This function allow you to wrap any content with expandable area that can expand by clicking [+ See More] Link Very useful for the long content, that should keep simple first time.

Example usage:

dozent_expand_wrap( $content );

Note: the expand and collapse will be done via JavaScript


Parameters

$content

(null) (Optional) Main content that should be within wrap

Default value: null

$wrap_class

(array) (Optional) Additional Wrap class

Default value: array()

$echo

(bool) (Optional) weather it will print or return

Default value: true


Return

(mixed|void)


Source

File: includes/template-functions.php

	function dozent_expand_wrap( $content = null, $wrap_class = [], $echo = true ) {

		$wrap_class = (array) $wrap_class;
		$wrap_class = implode( " ", array_filter( $wrap_class ) );

		$wrap
			= "<div class='dozent-expand-wrap {$wrap_class} '><div class='dozent-expand-inner'> {$content} </div></div>";

		/**
		 * Filter the wrap content of dozent_expand_wrap() function data
		 *
		 * @since DozentLMS 1.0.0
		 *
		 * @param  string  $content  Main content
		 *
		 * @param  string  $wrap  HTML formatted data
		 */

		$output = apply_filters( 'dozent_expand_wrap', $wrap, $content );

		if ( $echo ) {
			echo $output;
		}

		return $output;
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.