{
  "name": "bricks/conditions/options",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-conditions-options/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/conditions/options",
  "description": {
    "en": "Filters the condition options available in the element conditions interface. This allows you to add custom conditions that users can select to control element visibility.",
    "zh": "筛选 Bricks 构建器中元素条件界面上可用的条件选项。允许你向现有条件类别中添加新条件，或完全添加新的自定义条件类别。"
  },
  "parameters": [
    {
      "name": "options",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "Array of condition options. Each option defines the condition key, label, group, comparison operators, and value input type.",
        "zh": "条件选项数组。每个选项定义条件键、标签、组、比较运算符和值输入类型。"
      }
    }
  ],
  "example_usage": "add_filter( 'bricks/conditions/options', function( $options ) {\n    // Add a custom 'Is Weekend' condition\n    $options[] = [\n        'key'     => 'is_weekend',\n        'group'   => 'other', // Or a custom group created via bricks/conditions/groups\n        'label'   => esc_html__( 'Is Weekend', 'my-plugin' ),\n        'compare' => [\n            'type'        => 'select',\n            'options'     => [\n                '==' => esc_html__( 'is', 'bricks' ),\n            ],\n        ],\n        'value'   => [\n            'type'    => 'select',\n            'options' => [\n                'true'  => esc_html__( 'True', 'bricks' ),\n                'false' => esc_html__( 'False', 'bricks' ),\n            ],\n        ],\n    ];\n\n\n    return $options;\n} );"
}