[wp-trac] [WordPress Trac] #14914: Potential Bug in wp_update_term() when using get_term filter

WordPress Trac wp-trac at lists.automattic.com
Sat Jan 15 04:15:06 UTC 2011


#14914: Potential Bug in wp_update_term() when using get_term filter
--------------------------+----------------------
 Reporter:  jfarthing84   |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Taxonomy      |     Version:  3.0.1
 Severity:  major         |  Resolution:  invalid
 Keywords:  dev-feedback  |
--------------------------+----------------------
Changes (by mdawaffe):

 * status:  reopened => closed
 * resolution:   => invalid


Comment:

 Replying to [comment:2 jfarthing84]:
 > Actually, I am returning a taxonomy object, along with additional
 properties.

 A taxonomy object looks like:

 {{{
 stdClass::__set_state(array(
    'term_id' => '1',
    'name' => 'Uncategorized',
    'slug' => 'uncategorized',
    'term_group' => '0',
    'term_taxonomy_id' => '1',
    'taxonomy' => 'category',
    'description' => '',
    'parent' => '0',
    'count' => '36',
 ))
 }}}

 From what I gather, you're returning something like:

 {{{
 stdClass::__set_state(array(
    'term_id' => '1',
    'name' => 'Uncategorized',
    'slug' => 'uncategorized',
    'term_group' => '0',
    'term_taxonomy_id' => '1',
    'taxonomy' => 'category',
    'description' => '',
    'parent' => '0',
    'count' => '36',
    'something' =>
   stdClass::__set_state(array(
      'term_id' => '165',
      'name' => 'tag',
      'slug' => 'tag',
      'term_group' => '0',
      'term_taxonomy_id' => '167',
      'taxonomy' => 'post_tag',
      'description' => '',
      'parent' => '0',
      'count' => '0',
   )),
 ))
 }}}

 That "additional property" is unsupported and is not a "taxonomy object"
 as far as WordPress is concerned, so this is not a bug.

 It may not fit your aesthetic, but I believe there is a perfectly
 functional workaround for what you're trying to do.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14914#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list