Skip to content

Custom Taxonomy metabox information not saved properly #977

@teachmeter

Description

@teachmeter

Describe the bug
When having a custom post type taxonomy (hierarchical) when saving a custom post with ACF enabled the taxonomies are not saved all but only 1 selection.

To Reproduce
Steps to reproduce the behavior:

  1. Go to custom post
  2. Select custom taxonomies from standard wordpress metabox (select multiple)
  3. Click save post
  4. See only 1 taxonomy saved

Expected behavior
All taxonomies should be assigned to a post

Code
The following line seems to be the problem
plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-taxonomy.php:414

Changing the following line
from
wp_set_object_terms( $id, $term_ids, $taxonomy, false );
to
wp_set_object_terms( $id, $term_ids, $taxonomy, true ); seems to solve the problem

Version Information:

  • WordPress Version 6.8.2
  • PHP Version 8.3
  • ACF Version ACF PRO 6.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions