{
  "name": "bricks/api/get_templates_data",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-api-get_templates_data/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/api/get_templates_data",
  "description": {
    "en": "Filters the data returned by the Bricks REST API endpoint /get-templates-data/ . This endpoint is used to retrieve templates, authors, bundles, tags, and other assets for the template library.",
    "zh": "筛选 Bricks REST API 端点 /get-templates-data/ 所返回的数据。该端点用于检索模板、作者、合集、标签以及其他模板库资源。"
  },
  "parameters": [
    {
      "name": "templates_data",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "Array containing:",
        "zh": "包含以下内容的数组："
      },
      "sub_params": [
        {
          "name": "templates",
          "type": "array",
          "type_zh": null,
          "description": {
            "en": "List of template data.",
            "zh": "模板数据列表。"
          }
        },
        {
          "name": "authors",
          "type": "array",
          "type_zh": null,
          "description": {
            "en": "List of template authors.",
            "zh": "模板作者列表。"
          }
        },
        {
          "name": "bundles",
          "type": "array",
          "type_zh": null,
          "description": {
            "en": "List of template bundles.",
            "zh": "模板合集列表。"
          }
        },
        {
          "name": "tags",
          "type": "array",
          "type_zh": null,
          "description": {
            "en": "List of template tags.",
            "zh": "模板标签列表。"
          }
        },
        {
          "name": "globalVariables",
          "type": "array",
          "type_zh": null,
          "description": {
            "en": "Global variables.",
            "zh": "全局变量。"
          }
        },
        {
          "name": "colorPalette",
          "type": "array",
          "type_zh": null,
          "description": {
            "en": "Color palettes.",
            "zh": "调色板。"
          }
        },
        {
          "name": "timestamp",
          "type": "int",
          "type_zh": null,
          "description": {
            "en": "Current timestamp.",
            "zh": "当前时间戳。"
          }
        },
        {
          "name": "date",
          "type": "string",
          "type_zh": null,
          "description": {
            "en": "Formatted date.",
            "zh": "格式化日期。"
          }
        },
        {
          "name": "get",
          "type": "array",
          "type_zh": null,
          "description": {
            "en": "URL parameters from the request.",
            "zh": "请求中的 URL 参数。"
          }
        }
      ]
    }
  ],
  "example_usage": "add_filter( 'bricks/api/get_templates_data', function( $templates_data ) {\n    // Example: Remove a specific template bundle by name\n    if ( ! empty( $templates_data['bundles'] ) ) {\n        foreach ( $templates_data['bundles'] as $key => $bundle ) {\n            if ( $bundle === 'Deprecated Bundle' ) {\n                unset( $templates_data['bundles'][ $key ] );\n            }\n        }\n    }\n\n\n    return $templates_data;\n} );"
}