Dynamic blocks
acpt/list-blocks, acpt/get-block, acpt/save-block, acpt/delete-block
Category: acpt-content-model · Default capability: manage_options
acpt/list-blocks
Returns every ACPT dynamic block
acpt/get-block
Returns a single block by name
acpt/save-block
Creates a block, or updates it if the name already exists
acpt/delete-block
Deletes a block
acpt/list-blocks
No input required.
$result = wp_get_ability('acpt/list-blocks')->execute();acpt/get-block
Input
name
string
Yes
$result = wp_get_ability('acpt/get-block')->execute([
'name' => 'movie-hero',
]);{
"success": true,
"message": "Operation completed successfully.",
"data": {
"id": "a6b7c8d9-0123-4abc-9def-0123456789ab",
"name": "movie-hero",
"title": "Movie Hero",
"category": "acpt",
"icon": "cover-image",
"css": null,
"callback": null,
"keywords": ["movie", "hero"],
"postTypes": ["movie"],
"controls": [
{
"id": "b7c8d9e0-1234-4abc-9def-0123456789ab",
"name": "overlay_opacity",
"label": "Overlay opacity",
"type": "Range",
"default": "50",
"settings": {}
}
],
"scriptName": "movie_hero_block_js",
"blockName": "acpt-dynamic-blocks/movie-hero",
"supports": []
}
}acpt/save-block
Input
name
string
Yes
If a block with this name already exists, it's updated instead of duplicated
title
string
Yes
category
string
Yes
The Gutenberg block category slug
postTypes
array<string>
Yes
Post types the block is available in
controls
array
Yes
The block's editable controls — each item needs at least a name; type is one of Checkbox, Radio, Select, SelectMulti, Toggle, Text, Textarea, Number, Range, Email, Phone
css
string|null
No
callback
string|null
No
keywords
array|null
No
acpt/delete-block
Input
name
string
Yes
Last updated