[wp-trac] [WordPress Trac] #7357: wp_update_term_count_now default
behavior doesn't work
WordPress Trac
wp-trac at lists.automattic.com
Sat Jul 19 21:05:32 GMT 2008
#7357: wp_update_term_count_now default behavior doesn't work
----------------------+-----------------------------------------------------
Reporter: filosofo | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.7
Component: General | Version:
Severity: normal | Keywords: wp_update_term_count_now term taxonomy
----------------------+-----------------------------------------------------
{{{wp_update_term_count_now}}} takes as its first argument an array of
term ids, and the terms' taxonomy as its second. Then it updates the
terms' counts based on the number of times a term in that taxonomy has a
relationship with an object.
If there is a {{{update_search_term_count}}} callback defined for that
taxonomy, then {{{wp_update_term_count_now}}} calls the callback to do the
term counting. Categories and tags do have their own
{{{update_search_term_count}}} callback defined, so normally there is no
problem.
However, for any taxonomy that does not have the callback defined,
{{{wp_update_term_count_now}}} by default updates the count on its own.
And that's where the problem is, because it suddenly treats term_ids as
though they were term_taxonomy_ids, which doesn't work.
My patch fixes the problem by retrieving a term's term_taxonomy_id and
updating the term count properly.
--
Ticket URL: <http://trac.wordpress.org/ticket/7357>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list