[wp-trac] [WordPress Trac] #41739: Support a "source" attribute in post types, taxonomies, and post statuses

WordPress Trac noreply at wordpress.org
Mon Aug 28 02:07:33 UTC 2017


#41739: Support a "source" attribute in post types, taxonomies, and post statuses
-----------------------------+-----------------------------
 Reporter:  johnjamesjacoby  |      Owner:
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  General          |    Version:  3.0
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 When registering custom post types, taxonomies, or post statuses, it would
 be nice to have a way to tell the system what plugin was responsible for
 those registrations.

 Use Case:

 In bbPress, there are 3 post types, 1 taxonomy, and 4 post statuses. There
 are several places where an "any bbPress post type" or "any bbPress post
 status" comparison is necessary, but it's somewhat annoying and repetitive
 to need to write:

 {{{
 array( bbp_get_forum_post_type(), bbp_get_topic_post_type(),
 bbp_get_reply_post_type() )
 }}}

 I'd prefer to write:

 {{{
 get_post_types( array( 'source' => 'bbpress' ) )
 }}}

 Tangentially, this could replace the otherwise vague `internal` property,
 with:

 {{{
 'source' => 'wordpress'
 }}}

 I'm not confident that `source` is the best descriptor, or if `domain` or
 `namespace` or something else might be more appropriate (without being too
 vague to be useful.)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41739>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list