I removed the _split_terms
row in my options table. That solved the problem. I know that there are no Plugins, that use old term ids, so that is not a problem I hope.
But I still don’t know, what to do now :/
“Ägypten” (id: 29) was once a category. I used a plugin to convert the category into a post_tag. My theory is, that wp_get_split_term
somehow returns the id of the old category, that doesn’t exist anymore.
I followed the code a litte bit more.
in ‘api-helpers.php’ in function ‘acf_get_valid_terms’ my value is int(29) before this code:
// attempt to find new terms
foreach( $terms as $i => $term_id ) {
$new_term_id = wp_get_split_term($term_id, $taxonomy);
if( $new_term_id ) {
$terms[ $i ] = $new_term_id;
}
}
and int(618) after it. but i still don’t know why..
[edit]
Output of wp_get_split_term(29, 'post_tag')
is 618. So i guess my term database table is broken?
Sorry for the comment spam.
The filter doesn’t come from a plugin or a theme, it’s a filter from the class acf_field in field.php.
this line in __construct changes my String “29” into a int 618.
$this->add_filter("acf/load_value/type={$this->name}", array($this, 'load_value'), 10, 3);
Its the filter acf/load_value/type=taxonomy
why?
ah, before this line in acf’s ‘api-value.php’ in function ‘acf_get_value’ its 29:
$value = apply_filters( "acf/load_value/type={$field['type']}", $value, $post_id, $field );
after that its 618. So I have to check the theme and the plugins I guess. Or is that a known bug?
I made a litte bug search. And I tried to query the variable manually.
get_field('kgk_dossier_2', 'option')
Output: 618
----
get_option('options_kgk_dossier_2', null);
Output: "29"
I dont get it… :/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.