Support

Account

Home Forums Backend Issues (wp-admin) Display taxonomy custom field in back office

Solved

Display taxonomy custom field in back office

  • Hi, i added an image field to a taxonomy to associate icon and term, i use this taxonomy in a custom post type as a select, the select only display the term name, how wan i also display the image please ?

  • Ok solved it alone, sharing here if ever someone needs it.

    function icon_avant_term( $title, $term, $field, $post_id ) {
            
            if(is_admin() && ("produits" == get_post_type($post_id)) ){
                
                $taxo = $title;
                $image = get_field('icone_liste_plus', $term);
                $title =  '<img src="'.$image['url'].'" /> ' . $taxo;
                return $title;
            
            }
    
        }
    
        add_filter('acf/fields/taxonomy/result/name=point_cle_produit_icon', 'icon_avant_term', 10, 4);
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Display taxonomy custom field in back office’ is closed to new replies.