[wp-trac] [WordPress Trac] #27094: get_boundary_post() doesn't work for custom post types

WordPress Trac noreply at wordpress.org
Mon Oct 5 13:09:28 UTC 2015


#27094: get_boundary_post() doesn't work for custom post types
--------------------------+-----------------------------
 Reporter:  PioneerSkies  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Query         |     Version:  3.8.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------
Changes (by tyxla):

 * keywords:  needs-patch needs-unit-tests => has-patch


Comment:

 I've just added 2 patches, because I am not sure if this function should
 also support pages (the workaround from @SergeyBiryukov makes me think
 that pages should also be supported).

 Both patches take advantage of the current post and use its post type, so
 there is no need for a new function or a function argument.

 **27094-cpt.patch**

 * Adds support for custom post types, fetches the post type automatically
 from the current post.
 * Contains a unit test for the custom post type use case.
 * Contains a unit test for the `attachment` post type - the function
 should return `NULL` for attachments.

 **27094-cpt-with-page.patch**

 * Adds support for custom post types, fetches the post type automatically
 from the current post.
 * Adds support for the `page` post type.
 * Contains a unit test for the custom post type use case.
 * Contains a unit test for the `attachment` post type - the function
 should return `NULL` for attachments.
 * Contains a unit test for the `page` post type.

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


More information about the wp-trac mailing list