Home Forums ACF PRO ACF the WP-API and a unique repeater row id


ACF the WP-API and a unique repeater row id

  • Hi,

    This is a sort of advanced topic. I am using ACF and consuming the data via the WP-API. I was wondering if there was a way to have a repeater create a unique ID for each row. I did not see it in the field types. It would be perhaps a GUID or some auto-number. I know it exists in the WP Meta data but it is not exposed in the API.

    For example, the JSON returns a repeater as this

    "acf": {
    "dt_result": [
    "result_title": "Program Identity",
    "result_text": "Here is some copy",
    "result_title": "No Program Identity",
    "result_text": "Here is some other copy"

    Is it possible to have ACF return this

    “acf”: {
    “dt_result”: [
    “id”: “GUID”,
    “result_title”: “Program Identity”,
    “result_text”: “Here is some copy”,
    “id”: “GUID2”,
    “result_title”: “No Program Identity”,
    “result_text”: “Here is some other copy”

    The reasons for this should be obvious to anyone who has dealt with data.


  • This is what you’re looking for: 🙂

    Just install it like you would any other plugin and then you should be able to add a unique ID field to any row, group etc…

  • Very nice! This worked great. Of course you can install without composer by adding this to your functions file.

    // Repeater unique ID in a folder called functions in my theme


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

The topic ‘ACF the WP-API and a unique repeater row id’ is closed to new replies.