{
  "name": "bricks/conditions/result",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-conditions-result/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/conditions/result",
  "description": {
    "en": "Filters the boolean result of a condition check. This filter is used to implement the logic for custom conditions or to override existing condition logic.",
    "zh": "筛选 Bricks 控制面板的内容元素类别。"
  },
  "parameters": [
    {
      "name": "result",
      "type": "bool",
      "type_zh": null,
      "description": {
        "en": "The result of the condition evaluation.",
        "zh": "条件评估的结果。"
      }
    },
    {
      "name": "condition_key",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The key of the condition being evaluated (e.g., user_role , my_custom_condition ).",
        "zh": "正在被评估的条件键（例如 user_role、my_custom_condition）。"
      }
    },
    {
      "name": "condition",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "The condition settings (contains compare , value , etc.).",
        "zh": "条件设置（包含 compare、value 等）。"
      }
    }
  ],
  "example_usage": "add_filter( 'bricks/conditions/result', function( $result, $condition_key, $condition ) {\n    // Logic for custom 'is_weekend' condition\n    if ( $condition_key === 'is_weekend' ) {\n        $is_weekend = ( date( 'N' ) >= 6 );\n        $value      = isset( $condition['value'] ) ? $condition['value'] : 'true';\n\n\n        // Check if condition value matches current state\n        if ( $value === 'true' ) {\n            return $is_weekend;\n        } else {\n            return ! $is_weekend;\n        }\n    }\n\n\n    return $result;\n}, 10, 3 );"
}