Support

Account

Home Forums Gutenberg Gutenberg – Get values from another post Reply To: Gutenberg – Get values from another post

  • I know I may be a little late to the party but I believe that I found a solution to this. Maybe something that was added to an update since last this was reviewed, but I did the following to get a specific field that is from a block on another post.

    $postBlocks = parse_blocks($post->post_content);
    print_r($postContent); // Displays array of all blocks
    $postContent = $postBlocks[0]['attrs']['data']['custom_field_slug']; // Example
    echo $postContent;

    Hope you all are well,
    Darren