JS Filters
lzb.components.PreviewServerCallback.allowFetch
Filter called in editor preview before
fetching new block content. Use this action to conditionally disable fetching.
Attributes
Name | Type | Description |
---|---|---|
allow | Boolean | allow fetching flag |
data | Object | component data |
Usage
JS
wp.hooks.addFilter(
"lzb.components.PreviewServerCallback.allowFetch",
"my.custom.namespace",
function (allow, data) {
console.log(allow, data);
const maybePreventFetch = true;
if (maybePreventFetch) {
return false;
}
return allow;
}
);