4

I just want to know how the data from Advanced Custom Field blocks is stored in the Wordpress database? As I understand it, the way that Gutenberg works, is that on document save, all data from all blocks is concatenaded in to one chunk of code, and saved in only one spot in the database... But is this is same issue with the ACF blocks?

Jeppe R
  • 113
  • 1
  • 8

1 Answers1

2

They appear to be saved inside posts. If you look at the wp_posts table where a post has an ACF post block and a Gutenburg paragraph block, you'll see some content in the post_content column containing

<!-- wp:acf/testimonial {
    "id": "block_5d814c1a9446a",
    "name": "acf\/testimonial",
    "data": {
        "fred": "hey fred",
        "_fred": "field_5d814d9fcdede"
    },
    "align": "",
    "mode": "preview"
} /-->

<!-- wp:acf/testimonial {
    "id": "block_5d814c3c9446b",
    "name": "acf\/testimonial",
    "data": {
        "fred": "",
        "_fred": "field_5d814d9fcdede"
    },
    "align": "",
    "mode": "preview"
} /-->

<!-- wp:paragraph -->
<p>paragraph block</p>
<!-- /wp:paragraph -->

where wp:acf/testimonial is an ACF block and wp:paragraph is a Gutenburg paragraph block.

C0c0b33f
  • 176
  • 7
  • Ahem.. So this means that the ACF blocks are indeed gathering as one chunk? (meaning the_content) ? – Jeppe R Sep 19 '19 at 11:27
  • I was researching how to store content blocks for a custom react app. The way WP does it seems so convoluted... I was expecting each block to have a separate entry... – Adrian Moisa Mar 04 '20 at 17:28