WordPress.org

Forums

[resolved] get_categories returning duplicate child categories in 3.9 (4 posts)

  1. Bev
    Member
    Posted 1 year ago #

    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.

  2. Bev
    Member
    Posted 1 year ago #

    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 ) )
  3. Bev
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.