Support

Account

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.