Hi,
I have several custom “checkboxes” type attributes for listings, and I use some PHP snippets to read their values, using display_.
Example:
Attribute name (slug): amenities
Attribute value options: ac, wifi, kitchen, couch…etc
In my snippet, I need to use the amenities values, so I use $listing->display_amenities(); , which will return a string of checked values, like “ac, wifi, couch”. All fine. Now, if I reuse the $listing->display_amenities(); in the same snippet again (like in a foreach loop), it returns a different value now, like "ac, wifi, couch, " (note the last comma). This has an effect when using functions like explode to get those values in an array.
I think this means the function is not idempotent. I don’t know if this is by design or by mistake, but it gave me a lot of troubles because it was very difficult to debug and find the cause of my problems.
Hope this is useful info!