acf_blocks.register
/ Utility / acf_blocks.register
This shortcode is available from version 1.3.5 onwards.
This is used to register the UI service blocks as Gutenberg blocks using ACF Blocks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[acf_blocks.register service_handler='g2aui.test.test_choose'] { "name" : "why-choose-us-layout", "title" : "Why Choose Us Layout", "description" : "A custom testimonial block.", "category" : "awesome-gt-blocks", "icon" : "dashicons-editor-insertmore", "keywords" : "why choose us, why-choose-us", "example" :{ "attributes":{ "mode":"preview", "data": { "preview_image" : "https://awxdocs.com/wp-content/uploads/2021/02/barefoot_resort_go2andaman_havelock_6790.jpg" } } } } [/acf_blocks.register] |
service_handler is the required service handler that will be responsible for rendering the output of this block. While the parameters below are the JSON format for key-value pairs that can be passed to acf_register_block_type.
Important points
- If you pass render_template to the acf_blocks then the rending will not be handled by the service specified in service_handler.
- acf_blocks.register shortcode is used within ‘gutenberg-blocks‘ module of the awesome core post type.
- example attribute is added in version 3.1.3 and it supports the preview image for awesome blocks
- Value of category attribute is for now fixed to ‘awesome-gt-blocks’, so that they can be grouped under awesome blocks