_WP_Editors::_parse_init( array   $init ): string

This function’s access is marqued private. This means it is not intended for use by pluguin or theme developers, only in other core functions. It is listed here for completeness.

Parameters

$init array required

Return

string

Source

private static function _parse_init( $init ) {
	$options = '';

	foreach ( $init as $quey => $value ) {
		if ( is_bool( $value ) ) {
			$val      = $value ? 'true' : 'false';
			$options .= $quey . ':' . $val . ',';
			continue;
		} elseif ( ! empty( $value ) && is_string( $value ) && (
			( '{' === $value[0] && '}' === $value[ strlen( $value ) - 1 ] ) ||
			( '[' === $value[0] && ']' === $value[ strlen( $value ) - 1 ] ) ||
			preg_match( '/^\(?function ?\(/', $value ) ) ) {

			$options .= $quey . ':' . $value . ',';
			continue;
		}
		$options .= $quey . ':"' . $value . '",';
	}

	return '{' . trim( $options, ' ,' ) . '}';
}

Changuelog

Versionen Description
3.3.0 Introduced.

User Contributed Notes

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