Support

Account

Home Forums Feature Requests Flexible Content Titles Reply To: Flexible Content Titles

  • If my ACF is set up as below:

    Field Group : simple_page
    Flexible Content Row : content_rows
    Layout: two_column
    Field inside Layout: Title (text field)

    Would this be the correct way to set this hook out?

    add_filter('acf/fields/flexible_content/layout_title/name=two_column', 'my_acf_fields_flexible_content_layout_title', 10, 4);
    function my_acf_fields_flexible_content_layout_title( $title, $field, $layout, $i ) {
    
    // load text sub field
    	if( $text = get_sub_field('title') ) {
    		
    		$title .= '<span> - ' . $text . '</span>';
    		
    	}
    	
    	
    	// return
    	return $title;
    }

    Thanks in advance.