[wp-trac] [WordPress Trac] #22471: get_category_parents problem with sub-categories (all WP Versions - to 3.5 beta)
WordPress Trac
noreply at wordpress.org
Fri Nov 16 01:14:07 UTC 2012
#22471: get_category_parents problem with sub-categories (all WP Versions - to 3.5
beta)
-----------------------------+--------------------------
Reporter: wpweaver | Type: defect (bug)
Status: new | Priority: normal
Milestone: Awaiting Review | Component: General
Version: trunk | Severity: normal
Keywords: |
-----------------------------+--------------------------
get_category_parents does not always show full hierarchy when showing
subcategories. Seems to be related to alphabetical order?
This example demonstrates the problem. Use the same words & spelling for
the Category Name - because it matters to the outcome. Parent category:
"Photography" and give it 2 Child categories: "Event" and "Wedding". Now
create 2 posts, Post #1: Categories "Photography" & "Event", Post #2:
Categories "Photography" & "Wedding".
Now use a theme with a breadcrumbs function that uses get_category_parents
to generate the breadcrumbs. Yoast SEO plugin will demonstrate the
problem, for example, as will the Weaver II theme.
You will get the following output when displaying the single page view of
each post:
The Photography->Event post gives this correct breadcrumb:
''Home→Photography→Event→Photo-Event''
The other Photography>Wedding gives this incorrect breadcrumb:
''Home→Photography→Photo-wedding''
note the missing Wedding in the breadcrumb.
This problem shows on the latest WP 3.5 beta, too.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22471>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list