Home › Forums › Add-ons › Flexible Content Field › Value of a layout content block as a title › Reply To: Value of a layout content block as a title
I am using a simple layout title change using one of the layouts sub field, but mine is working when the value is changed/
add_filter('acf/fields/flexible_content/layout_title/key=field_5c659c4616508', 'panel_title'), 20, 4);
function panel_title($title, $field, $layout, $i) {
if (get_sub_field('panel_name')) {
$title = '<strong>'.get_sub_field('panel_name').'</strong> -- '.$layout['label'];
}
return $title;
}
Are you seeing any errors in your log? You need to turn on error logging https://codex.wordpress.org/WP_DEBUG. My assumption here is that there is something in your code that is triggering an error during the ajax request. Possibly in the way you are accessing the sub field values. Either that or there is something else on your site triggering an error during the request.
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.