Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #61936, comment 3


Ignore:
Timestamp:
09/01/2024 05:06:52 PM (15 months ago)
Author:
marian1
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #61936, comment 3

    initial v1  
    2525The `$args` that the taxonomies are registered with are located in `$t->args['args']`, not `$t->args`. Therefore, the condition `array_merge( $args, $t->args ) != $args )` is always true, but the incorrect array is merged. The statement "those parameters override the `$args` passed to this function" will never occur, except for `'hierarchical'`, which is part of both arrays. However, I am unsure whether this overriding should occur at all. If the `array_merge` worked as intended, each taxonomy could have a different `'fields'` value, resulting in a relatively unpredictable return type.
    2626
    27 While the function now returns the expected count when requesting a count, the actual value is still incorrect when more than one `object_id` is associated with a term due to double counting. However, I wanted to discuss this new issue first before continuing.
     27The function new returns the expected count when requesting a count. Like `get_terms()` and `WP_Term_Query->get_terms()`, it does not correct for double counting if the same term is assigned to multiple objects or taxonomies.
    2828
    2929It's also necessary to review the other functions that call `wp_get_object_terms()`.