Code: Select all
function register_acf_blocks() {
register_block_type(__DIR__ . '/blocks/primary-thin-banner');
}
add_action('init', 'register_acf_blocks');
Code: Select all
{
"name": "acf/primary-thin-banner",
"title": "Primary Thin Banner",
"description": "To add a thin banner. Can be used on any page.",
"category": "formatting",
"icon": "align-pull-left",
"keywords": ["page", "post", "primary", "thin", "banner"],
"acf": {
"mode": "edit",
"renderTemplate": "primary-thin-banner.php"
},
"supports": {
"align": false,
"anchor": true,
"customClassName": false,
"jsx": false,
"multiple": true,
"mode": true,
"inserter": true
},
"example": {
"attributes": {
"title": "Example Title",
"description": "Example description text that displays in the preview.",
"backgroundImage": "https://url-to-the-image.jpg"
}
}
}
Was ist die beste Vorgehensweise? Nun, um dies zu ermöglichen?
Und welcher JSON muss hinzugefügt werden?