Im trying to migrate my theme from sage 9 to 10 and everything works so far.
but when i try to use my acf blocks everything breaks:
registering my block / acf with block.json
add_action( 'init', function() {
register_block_type(__DIR__ . '/blocks/intro');
} );
render template
<?php
$className = 'intro';
$id = 'intro';
if ( ! empty( $block['anchor'] ) ) {
$id = $block['anchor'];
}
if ( ! empty( $block['className'] ) ) {
$className .= ' ' . $block['className'];
}
if ( ! empty( $block['align'] ) ) {
$className .= ' align' . $block['align'];
}
$background_image = get_field( 'hintergrund_bild' ) ?: null;
$template = [
[
'core/heading',
[
'textAlign' => 'left',
'level' => 1,
'content' => '<strong>Die Therapien<br></strong>im Überblick',
'textColor' => 'white'
]
],
[
'core/paragraph',
[
'textColor' => 'white',
'textAlign' => 'left',
'content' => 'Ausgezeichnete Medizinische Bewegungstherapie für Schmerzpatienten',
]
],
];
echo view( 'blocks/intro', compact( 'className', 'id', 'background_image', 'template' ) )->render();
when im just using echo "hello world";
everythin works