you can use get_sub_field() inside the filter.
Layouts do not have “IDs” built into ACF. If you want an ID then you need to build a field for that.
I do the same thing. I have a field in layouts that I make read only. I auto generate the value for these fields. The field is always named the same. This allows the client to copy and paste the ID from that field. It also allows me to auto generate links and navigation based on the field. Actually what I have a field group with layout settings that I clone into every layout. It consists of all of the common settings for every flex layout added.
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!