Skip to main content

Filter: gk/block-mcp/pattern/ref-scan-batch-size

Tune the memory/speed trade-off when counting pattern usage.

To work out how often each synced pattern is used, the plugin pages through post content in chunks rather than loading every row at once. Lower the batch size to shrink peak memory on a constrained host; raise it to finish the tally in fewer round-trips on a fast database. Values below 1 are clamped to 1.

Parameters

NameTypeDescription
$batch_sizeintNumber of post rows pulled per chunk. Default 200.

Example

// Use smaller batches on a memory-limited host.

add_filter( 'gk/block-mcp/pattern/ref-scan-batch-size', function () {
return 50;
} );

Since

Source

Defined in wordpress-plugin/gk-block-api/includes/class-pattern-manager.php at line 561