Archived topic
GenerateBlocks unique ID and WP All Import
3 replies · Started by Dmitrii on October 23, 2022
I'm using WP All Import to speed up my post creation process and I'd like to start incorporating GenerateBlock containers, but came across a potential issue that I need clarity on.
Is the field "uniqueID" necessary for creating GB containers?
For context, my posts feature 17 businesses and each business needs its own container (to keep things organized), which means I need to create 17 GB containers for each post.
On the WP All Import side, this is how I've currently set things up (capitalized fields are pulled in from a sheet that I upload to WP All Import):
!-- wp:heading -->
<h2>RESTAURANT TITLE</h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>COST PER PERSON</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>PHONE NUMBER</p>
<!-- /wp:paragraph -->
---
But I want it set up like this (without needing a unique ID for each GB container):
<!-- wp:generateblocks/container \{"uniqueId":"c457acb1","isDynamic":true,"blockVersion":2,"className":"restaurant-container"\} -->
!-- wp:heading -->
<h2>RESTAURANT TITLE</h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>COST PER PERSON</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>PHONE NUMBER</p>
<!-- /wp:paragraph -->
<!-- /wp:generateblocks/container -->
If I can't create a GB container without a unique ID, how could I create the block with PHP?
Hi Dmitrii,
Yes, GenerateBlocks uniqueIDs are needed for GenerateBlocks to work. To clarify, why are you wanting to remove the uniqueID?
As an alternative, would using a WP Group Block work as well?
Ah! I hadn't thought of WP Group Blocks - that works much better for my use case.
Thank you sir!
You're welcome Dmitrii!