This is the generated code I see for an ACF test block:
/* Creating Editor Blocks with ACF PRO */
function test_blocks_acf_blocks_init() {
// Check if ACF PRO function exists.
if( function_exists('acf_register_block_type') ) :
// Register blocks. Don't edit anything between the following comments.
/* Pinegrow generated Register Blocks Begin */
acf_register_block_type( array(
'name' => 'test-blocks/acf-block-test',
'title' => __( 'ACF Blocks Test #1', 'test_blocks' ),
'icon' => 'smiley',
'category' => 'custom-posts',
'render_template' => 'blocks/acf-block-test/acf-block-test.php',
'supports' => array('color' => array('background' => true,'text' => true,'gradients' => true,'link' => true,),'typography' => array('fontSize' => true,),'anchor' => true,'align' => true,'multiple' => false,'className' => false,),
'base_url' => test_blocks_plugin_base_url(),
'base_path' => test_blocks_plugin_base_path()
) );
/* Pinegrow generated Register Blocks End */
endif;
}
…and ACF Blocks do not work for me at all in my local installation. I have played around endlessly with the block settings, but everything looks fine (in terms of previewing the PHP and manually checking the file path in the generated plugin) whilst the HTML does not render in the backend editor nor the frontend.
My assumption was the render template is the likely cause, so I changed this line in the plugin code generated by Pinegrow:
'render_template' => plugin_dir_path(__FILE__) . 'blocks/acf-block-test/acf-block-test.php',
Which is in line with what I’ve used previously when working with ACF Blocks.
Immediately, no more issues. The block renders perfectly in Gutenberg and the frontend.
This is a very pressing issue for me. I’d greatly appreciate either a quick fix pushed out or someone explaining what I’m doing wrong for this to be required currently on my end.
Edit: adding this info as requested in the sticky thread:
- Which Operating System and version of the Operating system? macOS Ventura 13.5.2
- Running Pinegrow directly on the host system or in a Virtual Machine? Host system
- Pinegrow version number: 7.71
- Hardware details: M1 Pro 16" MacBook Pro, 32GB memory, 1TB storage
- Do you have a Firewall and/or Anti Virus running in the background? Only whatever is default for macOS
- Do you have a Webserver running in the background? Local by Flywheel, otherwise nothing