WordPress.org

Support

Support » Alpha/Beta » [Resolved] get_categories returning duplicate child categories in 3.9

[Resolved] get_categories returning duplicate child categories in 3.9

  • Using WordPress 3.9-alpha-27111

    My code:

    $terms = get_categories( array ('child_of' => $cat));

    If I dump the $terms returned there are several duplicate entries. This worked properly in 3.8.1.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I did a test with one WP install. First under 3.8.1 the results are:

    cat:4
    terms:Array ( [0] => stdClass Object ( [term_id] => 7 [name] => Child Category I [slug] => child-category-i [term_group] => 0 [term_taxonomy_id] => 7 [taxonomy] => category [description] => [parent] => 4 [count] => 1 [cat_ID] => 7 [category_count] => 1 [category_description] => [cat_name] => Child Category I [category_nicename] => child-category-i [category_parent] => 4 ) )

    Then I upgraded to 3.9, no other changes, and the results are:

    cat:4
    terms:Array ( [0] => stdClass Object ( [term_id] => 7 [name] => Child Category I [slug] => child-category-i [term_group] => 0 [term_taxonomy_id] => 7 [taxonomy] => category [description] => [parent] => 4 [count] => 1 [cat_ID] => 7 [category_count] => 1 [category_description] => [cat_name] => Child Category I [category_nicename] => child-category-i [category_parent] => 4 ) [4] => stdClass Object ( [term_id] => 7 [name] => Child Category I [slug] => child-category-i [term_group] => 0 [term_taxonomy_id] => 7 [taxonomy] => category [description] => [parent] => 4 [count] => 1 [object_id] => 1746 [filter] => raw [cat_ID] => 7 [category_count] => 1 [category_description] => [cat_name] => Child Category I [category_nicename] => child-category-i [category_parent] => 4 ) )
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] get_categories returning duplicate child categories in 3.9’ is closed to new replies.