Support

Account

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).