[wp-trac] [WordPress Trac] #34010: Add Ability to Fetch Post Types by Supports
WordPress Trac
noreply at wordpress.org
Mon Oct 26 16:22:15 UTC 2015
#34010: Add Ability to Fetch Post Types by Supports
-------------------------------------+-------------------------------------
Reporter: wpsmith | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses: administration,
needs-unit-tests | template
-------------------------------------+-------------------------------------
Changes (by swissspidy):
* keywords: has-patch dev-feedback 2nd-opinion needs-testing needs-unit-
tests => has-patch dev-feedback needs-unit-tests
Comment:
It's not uncommon to loop through to all post types to see if a post type
supports a given feature, so this is certainly of value in my opinion. I
don't think it's necessary to query by multiple features though.
[attachment:34010.diff] proposes a simple `function
get_post_types_by_support( $feature )` function
(`get_post_types_supporting` sounds good too). Basically
[https://gist.github.com/wpscholar/6273186 like in this gist], but without
needing to access the global variable.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34010#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list