Support

Account

Home Forums General Issues Category Color Reply To: Category Color

  • Hi John, thanks for you code! But seems to not work

    function cat_elementor_acf_fixer_picker($value, $post_id, $field) {
      $terms = wp_get_post_terms($post_id, 'product_cat');
      if (!is_wp_error($terms) && !empty($terms)) {
        foreach ($terms as $term) {
          if (get_field('colore_categoria', $term)) {
            $value = get_field('colore_categoria', $term);
          }
        }
      }
      return $value;
    }
    
    add_filter('acf/format_value/field_name=colore_categoria', 'cat_elementor_acf_fixer_picker', 20, 3);