Support

Account

Home Forums Add-ons Flexible Content Field Dynamic title for flexible content pane? Reply To: Dynamic title for flexible content pane?

  • Ooooh…. this is really cool!

    I had given each block a different key/name – so, I changed that to ‘block_title’ – so that I could keep it simple.

    `
    add_filter(‘acf/fields/flexible_content/layout_title’, function($title) {
    $ret = $title;
    if ($custom_title = get_sub_field(‘block_title’)) {
    $ret = sprintf($title . ‘: ‘ . ‘<strong>’ . $custom_title . ‘</strong>’);
    }
    return $ret;
    });
    `

    Hooray!!! So cool! Thanks @antishow !

    (for anyone else who finds this / the filter goes in your functions.php)