We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot save post terms submitted by taxonomy edit form with relationship bidirectional field.
To Reproduce
Create custom post type People and custom taxonomy Role for post type People.
People
Role
Add taxonomy field roles to People and enable save and load terms options.
roles
Add relationship field people_order for Role taxonomy.
people_order
Enable bidirectional relations between roles and people_order fields.
Create new People post and add a single value for roles field.
Edit role term by removing value from people_order field.
Expected behavior single-people.php
<p>Debug roles get_field: <?= json_encode(get_field('roles')) ?></p> <p>Debug roles get_the_terms: <?= json_encode(get_the_terms(get_the_ID(), 'role')) ?></p>
Debug roles get_field: false Debug roles get_the_terms: false
Actual behavior — the value still exists (loaded from wp object terms?)
Debug roles get_field: [55] Debug roles get_the_terms: [{"term_id":55,"name":"Director","slug":"director","term_group":0,"term_taxonomy_id":55,"taxonomy":"role","description":"","parent":0,"count":1,"filter":"raw"}]
Code acf-export.json
Version Information:
Additional context
The problem looks like solved when I comment this lines:
class-acf-field-taxonomy.php:381
// append $this->save_post_terms[ $taxonomy ] = array_merge( $old_term_ids, $term_ids ); // if called directly from frontend update_field(). -if ( ! did_action( 'acf/save_post' ) ) { $this->save_post( $post_id ); - return $value; -} return $value;
Looks like $this->save_post call is needed for this case.
$this->save_post
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Cannot save post terms submitted by taxonomy edit form with relationship bidirectional field.
To Reproduce
Create custom post type
People
and custom taxonomyRole
for post typePeople
.Add taxonomy field
roles
toPeople
and enable save and load terms options.Add relationship field
people_order
forRole
taxonomy.Enable bidirectional relations between
roles
andpeople_order
fields.Create new
People
post and add a single value forroles
field.Edit role term by removing value from
people_order
field.Expected behavior
single-people.php
Actual behavior — the value still exists (loaded from wp object terms?)
Code
acf-export.json
Version Information:
Additional context
The problem looks like solved when I comment this lines:
class-acf-field-taxonomy.php:381
Looks like
$this->save_post
call is needed for this case.The text was updated successfully, but these errors were encountered: