Title: _WP_Editors::_parse_init
Published: April 25, 2014
Last modified: April 28, 2025

---

# _WP_Editors::_parse_init( array $init ): string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#parameters)󠁿

 `$init`arrayrequired

## 󠀁[Return](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#return)󠁿

 string

## 󠀁[Source](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#source)󠁿

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

    	foreach ( $init as $key => $value ) {
    		if ( is_bool( $value ) ) {
    			$val      = $value ? 'true' : 'false';
    			$options .= $key . ':' . $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 .= $key . ':' . $value . ',';
    			continue;
    		}
    		$options .= $key . ':"' . $value . '",';
    	}

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

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-editor.php#L835)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-editor.php#L835-L855)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#related)󠁿

| Used by | Description | 
| [_WP_Editors::print_default_editor_scripts()](https://developer.wordpress.org/reference/classes/_wp_editors/print_default_editor_scripts/)`wp-includes/class-wp-editor.php` |

Print (output) all editor scripts and default settings.

  | 
| [_WP_Editors::editor_js()](https://developer.wordpress.org/reference/classes/_wp_editors/editor_js/)`wp-includes/class-wp-editor.php` |

Print (output) the TinyMCE configuration and initialization scripts.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/_wp_editors/_parse_init/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2F_parse_init%2F)
before being able to contribute a note or feedback.