Hi,
Thank you for contacting us and I'd be happy to assist.
> Can the repeatable groups be limited? (example I have first name, last name, etc. and of this group I would like there can be maximum two "records");
- Repeatable field groups don't have any built-in option to restrict or limit them to a certain number.
But, if you create a one-to-many relationship between two post types, for example, 'Listings' -> 'Listing Records', you can set how many 'Listing Records' posts can be attached to a single 'Listing' posts. The actual custom fields like first name, last name, etc will be stored with the related 'Listing Records' post type, in this case.
> at the DB level does having many repeatable fields/groups affect weight and performance? I am assuming to enter about 50/100 records year of my custom post type.
- Whether you use a "repeatable field group" or regular 'one-to-many' post-relationship at the database level the structure to save them is the same.
Any custom fields that are inside a 'repeatable field group' are not stored with the actual post type, directly. A hidden custom post type is registered for each defined 'repeatable field group' and those custom fields are stored with that post type. And this post type is connected to the actual/parent post type through a hidden 'one-to-many' post-relationship too.
So in terms of performance, whether you use a 'repeatable field group' or a separate custom post type (linked through post-relationship) to store multiple records, it shouldn't make any difference.
> this data will be user editable in a restricted area (I bring this back to complete the information).
- Yes, you can use the post edit form to edit these records, regardless, of whether you choose the 'repeatable field group' or a separate custom post type approach.
> when I delete a record of my custom post type all data at the DB level is deleted (I ask for confirmation).
- When the actual/parent custom post type will be will be deleted, the data/custom fields stored with the connected/related post types will not be deleted automatically.
( again this is true for both approaches )
To achieve this, you'll need to include some custom code, that would execute whenever a post from the actual/parent post type is deleted, it deletes the data from the connected/related posts too.
I hope this helps and please let me know if you need further assistance.
regards,
Waqar