[wp-trac] [WordPress Trac] #35567: New argument `is_embeddable` for `register_post_type()`

WordPress Trac noreply at wordpress.org
Mon Mar 7 18:33:14 UTC 2016


#35567: New argument `is_embeddable` for `register_post_type()`
-------------------------------------------------+-------------------------
 Reporter:  pampfelimetten                       |       Owner:  bradleyt
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
Component:  Embeds                               |  Release
 Severity:  normal                               |     Version:  4.4
 Keywords:  good-first-bug has-patch has-unit-   |  Resolution:
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------

Comment (by swissspidy):

 I agree that we should keep support for embeds of other objects in mind.
 At least we should make it as easy as possible.

 `is_post_embeddable()` has the benefit of allowing a default argument and
 falling back to the global `$post` easily. `is_object_embeddable()` sounds
 like we could use `get_queried_object()` there. Would love to see such an
 approach.

 @bradleyt You're right, a 404 should be triggered. Not sure if the embed
 template is the right place to add that check. It's definitely the
 easiest, but perhaps we should add this in `WP_Query()`. Ideas welcome.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35567#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list