Home › Forums › Feature Requests › Feature Request: Flexible Content – Show a definable field's value as title › Reply To: Feature Request: Flexible Content – Show a definable field's value as title
I’ve implemented this as outlined in the link but when you collapse an item the title loses the sub_field data until you refresh the page again. Screengrab attached and my code below:
function my_acf_flexible_content_layout_title( $title, $field, $layout, $i ) {
if( $text = get_sub_field('anchor_name') ) {
$title = '<strong>' . $text . '</strong> - <em>'.$title.'</em>';
}
return $title;
}
add_filter('acf/fields/flexible_content/layout_title/name=content_blocks', 'my_acf_flexible_content_layout_title', 10, 4);
This is problematic since users will likely collapse as they go and then re-order.
Any idea why this is happening?
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.