WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 6 months ago

#15029 new defect (bug)

Make it possible to determine resource in get_ancestors()

Reported by: filosofo Owned by: filosofo
Milestone: Future Release Priority: normal
Severity: normal Version: 3.1
Component: Taxonomy Keywords: has-patch needs-refresh
Focuses: Cc:

Description

In case there exists a conflict between taxonomy and post_type names, allow it to be resolved explicitly when calling get_ancestors().

Attachments (3)

determine_ancestor_resource_type.15029.diff (2.1 KB) - added by filosofo 4 years ago.
determine_ancestor_resource_type.15029.2.diff (2.2 KB) - added by filosofo 4 years ago.
determine_ancestor_resource_type.15029.3.diff (2.2 KB) - added by filosofo 4 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 filosofo4 years ago

Please ignore the first patch with its logic flaw.

comment:2 demetris4 years ago

There is a typo in the @param doc line for the new parameter: resorce. :-)

comment:3 filosofo4 years ago

Well, time to get some coffee.

comment:4 scribu4 years ago

I think we should prevent conflicts between post_type and taxonomy names at the registration step, not later.

comment:5 scribu4 years ago

On second thought, nevermind. I was thinking about query_var, which doesn't have to corespond to the taxonomy name.

comment:6 follow-up: scribu4 years ago

By the way, shouldn't we also check if the post type is hierarchical, like we do for taxonomies?

comment:7 in reply to: ↑ 6 filosofo4 years ago

Replying to scribu:

By the way, shouldn't we also check if the post type is hierarchical, like we do for taxonomies?

Agreed; I don't think is_post_type_hierarchical existed when I wrote the original patch.

I also agree that checking query_var and maybe rewrite slug are good ideas.

comment:8 scribu4 years ago

  • Keywords needs-refresh added

comment:9 scribu4 years ago

  • Milestone changed from 3.1 to Future Release

Enhancement, no patch, punting.

comment:10 nacin6 months ago

  • Component changed from General to Taxonomy
Note: See TracTickets for help on using tickets.