Home Forums Bug Reports Repeater no saving correct taxonomy values


Repeater no saving correct taxonomy values

  • I created a repeater row that has two taxonomy fields in the row.

    When I save, the posts taxonomies save and are related to the post but all of the repeater rows now have the same value as the first row in the repeater.

    Does the taxonomy need to be registered at a certion order on the WordPress init hook?

  • The terms selected are related to the post and not the repeater row. If you have save terms turned on then each field sets the terms associated with the post, each field that’s save will override whatever was previously saved. This means that whichever one is saved last will determine the terms of the post. If you want each field row to have different terms then you can’t have ACF save the terms and they cannot be associated with the post.

  • It looks like it was because I had the option selected that reads “Load Terms – Load value from posts terms.”

    What does this value do?

  • I matches the values in the field to the terms of the post.

    Here’s an example using posts.

    When you edit a post you can select 1 or more categories on the right side of the editor.

    When you create a taxonomy field for categories that is shown on posts as well.

    If you have “Load Terms” set to yes then whatever is selected in the standard category box will be loaded into the taxonomy field and it will override whatever is selected there.

    If you have “Save Terms” set to yes then whatever you select in the taxonomy field will override what is in the standard category field.

    This is useful for making it possible to only select a single category. By default WP allows multiple categories. Using WP filters you can hide the standard category box and add a taxonomy field that only allows 1 selection.

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

The topic ‘Repeater no saving correct taxonomy values’ is closed to new replies.