Home Forums General Issues SELECT2JS



  • Hi,

    I would like that my ACF taxonomy list looks like the defautl library
    In my case, a hierarchy list, i need to have BOLD on first level and more indentation on 2nd level.

    I don’t understand why ACF does not keep the SELECT2JS default presets that are much better visually.
    ACF adds ‘ – ‘ for 2nd level and nogt BOLD on first.
    Thanks for help.

  • Not sure I understand what you’re looking for help with. If you are suggesting that ACF changes this you can submit a support ticket here

    If you want to alter the way the text is shown in the select field ACF has a filter to let you do that

  • Yes maybe ACF could change the look of taxonomy field.

    But yes also, in my case, maybe can i use the filter you tell me, can i insert html tags into ?

    I wish:


    <padding 20px> 2nd level
    <padding 20px> 2nd level
    <padding 20px> 2nd level

  • Honestly, I don’t know. I have never used this filter. But as I understand it Select2 is supposed to be able to handle html in select labels. You’d have to test it to find out.

  • what is strange is that when i use the filter as written in demo only to test, my list is empty (there are line items but no text…

    function my_post_object_result( $title, $term, $field, $post_id ) {
        // add the term's slug to each result
        $title .= '(' . $term->slug .  ')';
        return $title;
    add_filter('acf/fields/taxonomy/result', 'my_taxonomy_result', 10, 4);
  • Well, it’s doing something. But I haven’t got a clue why your getting no label listed at all.

  • very strange because same number of items (line items) but white with no text…

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.