Home › Forums › Gutenberg › Getting data from custom fields outside of blocks › Reply To: Getting data from custom fields outside of blocks
From what I understand you’re working inside an ACF block and want to get data from another block on the same page.
You can get block data from a page like so:
$post = get_post($post_id);
$blocks = parse_blocks($post->post_content);
$blocks here will be an array of all blocks in the page, this includes their basic info and all the data (fields).
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.