[wp-trac] [WordPress Trac] #55162: Incorrect parameter passed to update_term_cache from _prime_term_caches
WordPress Trac
noreply at wordpress.org
Mon Feb 14 19:01:20 UTC 2022
#55162: Incorrect parameter passed to update_term_cache from _prime_term_caches
--------------------------+-----------------------------
Reporter: david.binda | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 4.6
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
The `update_term_cache` function has a
[https://core.trac.wordpress.org/browser/trunk/src/wp-
includes/taxonomy.php#L3766 deprecated parameter] `string $taxonomy`,
which is not used. the `_prime_term_caches` function
[https://core.trac.wordpress.org/browser/trunk/src/wp-
includes/taxonomy.php#L3993 is calling] the `update_term_cache` while
passing in it's own parameter `$update_meta_cache`, which is of a boolean
type, and has nothing to do with taxonomy.
As the `update_term_cache` has deprecated the `$taxonomy` parameter, there
is no harm in passing in the bool value as second argument, but it makes
the code less readable, as it's clearly wrong.
It seems like it has been that way since introduction in r37573
From my point of view, the `_prime_term_caches` should be calling the
`update_term_cache` function with a single argument.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55162>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list