wphooks.info - wp_code_editor_settings

wp_code_editor_settings

*** New in v4.9 ***

The hook occurs in the following file:

wp-includes/general-template.php:
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
	 *     @type string   $type       The MIME type of the file to be edited.
	 *     @type string   $file       Filename being edited.
	 *     @type WP_Theme $theme      Theme being edited when on theme editor.
	 *     @type string   $plugin     Plugin being edited when on plugin editor.
	 *     @type array    $codemirror Additional CodeMirror setting overrides.
	 *     @type array    $csslint    CSSLint rule overrides.
	 *     @type array    $jshint     JSHint rule overrides.
	 *     @type array    $htmlhint   JSHint rule overrides.
	 * }
	 */
	$settings = apply_filters( 'wp_code_editor_settings', $settings, $args );

	if ( empty( $settings ) || empty( $settings['codemirror'] ) ) {
		return false;
	}

	wp_enqueue_script( 'code-editor' );
	wp_enqueue_style( 'code-editor' );

	if ( isset( $settings['codemirror']['mode'] ) ) {