Inner Blocks data string and storage

Support MB Blocks Inner Blocks data string and storageResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #44972
    Nicholas CoxNicholas Cox
    Participant

    Hi

    I have read over the Inner Blocks docs and wondered do you have examples of how the inner blocks are saved in a json string with the parent block?

    e.g. https://docs.metabox.io/extensions/mb-blocks/#block-data
    <!-- wp:meta-box/hero-content {"id":"block_jyqlhbauqz4jz51ahab","data":{"image":"10","title":"Hi, I’m Martin Green","subtitle":"WEB DEVELOPER \u0026 DESIGNER","content":"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusa ntium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta suntlo explica bo. Nemo enim ipsam voluptatem quia voluptas.","signature":"9","button_text":"Discover More","button_url":"#","background_color":"#f5f7f8"},"align":"wide"} /-->

    Also if i save the above innerblock using 'storage_type' => 'custom_table', then will it create multiple table rows or will it store as one database table row?

    thanks

    #45001
    PeterPeter
    Moderator

    Hello,

    Only the custom field value will be saved to the custom table. The inner block content is saved to the post content normally.

    Here is the screenshot https://imgur.com/t6u09lW
    and data saved

    <!-- wp:meta-box/my-custom-block {"id":"mb-block-3e8ebc0b-2730-4e26-b6b1-d9bee2d81643","data":{"icon_meta":"bookmark","block_content":"\u003cp\u003eblock content here\u003c/p\u003e\n"}} -->
    <!-- wp:paragraph -->
    <p>test paragraph</p>
    <!-- /wp:paragraph -->
    
    <!-- wp:heading -->
    <h2 class="wp-block-heading">Test Heading</h2>
    <!-- /wp:heading -->
    <!-- /wp:meta-box/my-custom-block -->
    #45028
    Nicholas CoxNicholas Cox
    Participant

    ok thanks

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.