Support

Account

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?