Support

Account

Forum Replies Created

  • You place the reset_rows() function after you break out of the rows loop. The ‘field_name’ is the Repeater field’s slug.

  • Yeah when I posted my resulting database I realized I could change the return value in ACF to User ID, my bad. I can definitely see how that will be a lot more efficient in the queries. Are they automatically indexed when the value stored is an ID?

  • Thanks John,

    That was a very informative article you wrote. Sounds like it was good I asked this question to prevent future performance issues.

    If I read everything correctly in your article. You are creating a repeater field that the client gets to use, but than each save of the post converts the repeater field values into a hidden post_meta field. Which than is easy to query.

    I gave this a try and your code works great for doing the duplicate representation of the repeater. But it stores an awful lot of information. And the repeater seems like it should be much more efficient to query since all it stores is the ID of the users.

    Take a look at the 3 different versions of storing 3 users;

    • related_members – ‘Select Multiple Values’ Option on a generic relation field
    • related_trustees – repeater with relation subfield
    • related_trustee_wp – Converted repeaters into generic post meta

    RepeatersComparison

  • Hey everyone! I have some questions about relational fields and the best practices.

    Here is my structure: I have a custom post type called ‘Member’ that contains a relationship ACF field called ‘related_trustees’ that links multiple users (creating a bundle affect). I only need to store the users ID into this relationship.

    I have previously used the “Select Multiple Values” option for relating multiple users. It seemed to work fairly easy via WP_Query to get all of the related users or get all posts that user is related to.

    Now I purchased the ACF Pro version with the repeaters option and I assumed this would work even better for the purpose stated. But so far I have come across multiple new hurtles.

    Pros for Repeater

    • Better UI for adding and removing users in Admin panel (still pretty basic)

    Cons for Repeater

    I havn’t gotten as far as displaying the users for a specific Member post type. So maybe theres great advantages there? Please give me insight if I should U-turn back to ‘Select Multple Values’

Viewing 4 posts - 1 through 4 (of 4 total)