{
  "name": "bricks/builder/codemirror_config",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/filter-bricks-builder-codemirror_config/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/builder/codemirror_config",
  "description": {
    "en": "Use this filter to customize the configuration of CodeMirror 5, the code editor used within the builder. CodeMirror 5 is used in areas such as the Custom CSS setting for elements and the Code element settings, where it provides an interface for editing HTML, CSS, JavaScript, PHP, and more. You can refer to the CodeMirror 5 configuration documentation for more details on available options. In this example, the filter modifies the default CodeMirror configuration to: Parameters: Return:",
    "zh": "使用此筛选器可自定义 CodeMirror 5（在构建器内使用的代码编辑器）的配置。CodeMirror 5 用于元素的“Custom CSS”设置和 Code 元素设置等区域，提供 HTML、CSS、JavaScript、PHP 等编辑界面。可参考 CodeMirror 5 配置文档了解所有可用选项。在下例中，筛选器修改默认的 CodeMirror 配置以：参数：返回值："
  },
  "example_usage": "add_filter( 'bricks/builder/codemirror_config', function( $config ) {\n    // Disable auto-close brackets\n    $config['autoCloseBrackets'] = false;\n\n\n    // Disable line numbers\n    $config['lineNumbers'] = false;\n\n\n    // Override default tab size\n    $config['tabSize'] = 4;\n\n\n    return $config;\n});"
}