Hi, I just updated from 4.2.2 to 4.3.0, and the Custom Fields from Terms stopped working.
My code:`<?
foreach ($terms as $term) {
<?php
$field_query = $taxonomyName . '_' . $term->term_taxonomy_id;
if (get_field ('icono_pequeno', $field_query)):
echo (the_field ('icono_pequeno', $field_query));
endif;
?>`
The output is blank.
Hi @mandarinazul
Thanks for the report. Before we look into the source code, can you address these issues with your code?
1. Have you validated the data of $terms
2. Does your loop run correctly. Can you show this?
3. What is $taxonomyName
4. I think $term->term_taxonomy_id; should be $term->term_id;
5. Have you tested $field_query
6. echo (the_field is not needed, the_field will already echo the value.
Thanks
E
Hi!
1. Yes, it’s ok
2. My loop works ok, i’m working right now in a local server, tomorrow I will upload it to an online server
3. A string with the taxonomy slug: “categoria_proyecto”
4. Both term_taxonomy_id and term_id are the same string
5. Yes: “categoria_proyecto_10”
6. Thanks!
Now, something strange happened, I downloaded the 4.3.0 ZIP from wordpress site and copied the files directly to the plugins folder, and everything worked again fine. I couldn’t reproduce the bug again.
It was very strange. This morning, after I updated using wordpress back-end, the problem happened. I couldn’t reproduce the bug right now, but maybe it can occur only after updating from 4.2.2 to 4.3.0?
Hi @mandarinazul
Very strange! Who knows, but happy to hear it’s working for you!
Thanks
E