Home › Forums › Add-ons › Flexible Content Field › Give flexible fields slug IDs automatically. › Reply To: Give flexible fields slug IDs automatically.
@hube2 Thanks for the reply.
Using that code, I’ve set this up:
add_filter(
"acf/fields/flexible_content/layout_title",
function ($title, $field, $layout, $i) {
$fieldId = $field["id"];
return $title_value
? "<strong>$title</strong> - <small>#$fieldId</small>"
: "<small>$title</small>";
},
10,
4,
);
which shows the field ID (ie: field_61a5392dc9480) in the title bar, which is great.
I’m wondering if there is a way to not have the whole field collapse when clicking on the title bar? I’d like to be able to allow the admin to click/double-click on that field ID to copy it, but clicking it just collapses the field.
Also, found an issue where when you collapse and reopen the field group it erases the new title – like it is there til you collapse then it disappears. I read some forum posts asking how to fix this and I didn’t find anything that worked. Is this possible to fix? Maybe its an ajax issue?
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.