i have build a custom block (let’s name it “parent_block”) in wordpress and added fields via acf to it. my custom block “parent_block” uses innerblocks, which only allows to add another custom block (let’s name it “child_block”). there i also added fiels via acf to it.
so i have two seperate php files and added: “parent”: [ “parent_block” ], to my childs block json file.
now, i want to use some field values of child in my parent and vice versa to output the content.
in my “child_block” i can get my desired value with:
$headline = get_field(‘headline’);
if echo it in my parent_block i get “undefined array key”.
in short: how can i get a field from another block? how would i do that?