wp_code_editor_settings хук-фильтрWP 4.9.0

Filters settings that are passed into the code editor.

Returning a falsey value will disable the syntax-highlighting code editor.

Использование

add_filter( 'wp_code_editor_settings', 'wp_kama_code_editor_settings_filter', 10, 2 );

/**
 * Function for `wp_code_editor_settings` filter-hook.
 * 
 * @param array $settings The array of settings passed to the code editor. A falsey value disables the editor.
 * @param array $args     Args passed when calling `get_code_editor_settings()`.
 *
 * @return array
 */
function wp_kama_code_editor_settings_filter( $settings, $args ){

	// filter...
	return $settings;
}
$settings(массив)
The array of settings passed to the code editor. A falsey value disables the editor.
$args(массив)

Args passed when calling get_code_editor_settings().

  • type(строка)
    The MIME type of the file to be edited.

  • file(строка)
    Filename being edited.

  • theme(WP_Theme)
    Theme being edited when on the theme file editor.

  • plugin(строка)
    Plugin being edited when on the plugin file editor.

  • codemirror(массив)
    Additional CodeMirror setting overrides.

  • csslint(массив)
    CSSLint rule overrides.

  • jshint(массив)
    JSHint rule overrides.

  • htmlhint(массив)
    HTMLHint rule overrides.

Список изменений

С версии 4.9.0 Введена.

Где вызывается хук

wp_get_code_editor_settings()
wp_code_editor_settings
wp-includes/general-template.php 4279
return apply_filters( 'wp_code_editor_settings', $settings, $args );

Где используется хук в WordPress

Использование не найдено.