dozent_text_format( string $text = '', bool $nl2br = true )

Clean, Un-quotes a quoted text and finally convert new line to br tag


Description

This function helps you to return / echo clan, un-quoted, well formatted text (string) from the db.

Example usage:

dozent_text_format( $text );
dozent_text_format( $text, false ); //if you like to insert it to textarea value

See also


Parameters

$text

(string) (Optional)

Default value: ''

$nl2br

(bool) (Optional) whether should generate br tag on new line or not. false for textarea

Default value: true


Return

(mixed|void)


Source

File: includes/core-functions.php

	function dozent_text_format( $text = '', $nl2br = true ) {

		$formatted_text = stripslashes( $text );

		if ( $nl2br ) {
			$formatted_text = nl2br( $formatted_text );
		}

		/**
		 * Filter the dozent_text_format(); return value
		 *
		 * @since DozentLMS 1.0.0
		 *
		 * @see dozent_text_format();
		 *
		 * @param  string  $formatted_text  Formatted Text
		 * @param  string  $text  Original Text
		 * @param  bool  $nl2br  nl2br bool
		 *
		 */

		return apply_filters( 'dozent_text_format', $formatted_text, $text, $nl2br );
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.