Home › Forums › General Issues › (admin side) How to add a class to a repeater row without JS? › Reply To: (admin side) How to add a class to a repeater row without JS?
There aren’t any filters or actions that can be called to modify the element with
class='acf-row'. If that’s the element you mean, there is no “.row” class in ACF. So yes, the only way to do this is using JS.
The only possibility you have to alter that would be to use 2 acf/render_field actions, one before and one after acf renders the repeater. You could use a PHP output buffer starting the buffer before the repeater is rendered and then getting an altering the buffer contents after. However you’d need to parse the html that ACF outputs and figure out how to update the each row class. Probably possible but potentially an nightmare to do.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!