includes/class-parse-this-html.php
private static function limit_string( $value ) {
		$return = '';

		if ( is_numeric( $value ) || is_bool( $value ) ) {
			$return = $value;
		} elseif ( is_string( $value ) ) {
			if ( mb_strlen( $value ) > 5000 ) {
				$return = mb_substr( $value, 0, 5000 );
			} else {
				$return = $value;
			}

			// $return = html_entity_decode( $return, ENT_QUOTES, 'UTF-8' );
			$return = sanitize_text_field( trim( $return ) );
		}

		return $return;
	}
private static function limit_string( $value ) {
		$return = '';

		if ( is_numeric( $value ) || is_bool( $value ) ) {
			$return = $value;
		} elseif ( is_string( $value ) ) {
			if ( mb_strlen( $value ) > 5000 ) {
				$return = mb_substr( $value, 0, 5000 );
			} else {
				$return = $value;
			}

			// $return = html_entity_decode( $return, ENT_QUOTES, 'UTF-8' );
			$return = sanitize_text_field( trim( $return ) );
		}

		return $return;
	}
private static function limit_string ( $ value ) { $ return = '' ; if ( is_numeric ( $ value ) || is_bool ( $ value ) ) { $ return = $ value ; } elseif ( is_string ( $ value ) ) { if ( mb_strlen ( $ value ) > 5000 ) { $ return = mb_substr ( $ value , 0 , 5000 ) ; } else { $ return = $ value ; } // $return = html_entity_decode( $return, ENT_QUOTES, 'UTF-8' ); $ return = sanitize_text_field ( trim ( $ return ) ) ; } return $ return ; }
Utility method to limit the length of a given string to 5,000 characters.

@ignore
@since 4.2.0

@param string $value String to limit.
@return bool|int|string If boolean or integer, that value. If a string, the original value
if fewer than 5,000 characters, a truncated version, otherwise an
empty string.
Utility method to limit the length of a given string to 5 000 characters .