Bricks 中文文档:bricks_indexer

📄 原始资料  |  展开查看原始 JSON(bricks_indexer.json){ “name”: “bricks_indexer”, “kind”: “action”, “url”: “https://academy.bricksbuilder.io/developer/hooks/actions/bricks-indexer/”, “scraped_at”: “2026-08-29”, “hook_name”: “bricks_indexer”, “description”: { “en”: “Triggers the Bricks query filter in…

📄 原始资料  |  展开查看原始 JSON(bricks_indexer.json)
{
  "name": "bricks_indexer",
  "kind": "action",
  "url": "https://academy.bricksbuilder.io/developer/hooks/actions/bricks-indexer/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks_indexer",
  "description": {
    "en": "Triggers the Bricks query filter indexer job runner. Bricks schedules this action with WP-Cron every five minutes and also triggers it from the background indexing AJAX endpoint. The core indexer callback bails when the indexer is already running, then continues pending jobs until the queue is empty or server resource limits are reached.",
    "zh": "触发 Bricks 查询筛选索引器任务运行器。Bricks 通过 WP-Cron 每五分钟调度一次该动作,也会从后台索引 AJAX 端点触发它。当索引器已在运行时,核心索引器回调会直接返回,然后继续处理待办任务直到队列清空或达到服务器资源限制。"
  },
  "example_usage": "add_action( 'my_plugin_run_bricks_indexer', function() {\n    do_action( 'bricks_indexer' );\n} );"
}

前言

触发 Bricks 查询筛选索引器任务运行器。Bricks 通过 WP-Cron 每五分钟调度一次该动作,也会从后台索引 AJAX 端点触发它。当索引器已在运行时,核心索引器回调会直接返回,然后继续处理待办任务直到队列清空或达到服务器资源限制。

用法

将代码加入子主题的 functions.php

add_action( 'my_plugin_run_bricks_indexer', function() {
    do_action( 'bricks_indexer' );
} );

示例代码

触发自定义动作

add_action( 'my_plugin_run_bricks_indexer', function() {
    do_action( 'bricks_indexer' );
} );

补充说明

更多细节可参考 官方文档