[wp-trac] [WordPress Trac] #40413: Handle `register_post_type` support's array
WordPress Trac
noreply at wordpress.org
Tue Sep 17 20:33:15 UTC 2019
#40413: Handle `register_post_type` support's array
-------------------------------------------------+-------------------------
Reporter: MaximeCulea | Owner: desrosj
Type: enhancement | Status: reopened
Priority: normal | Milestone: 5.3
Component: Posts, Post Types | Version: 2.9
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests needs-dev- | Focuses:
note |
-------------------------------------------------+-------------------------
Comment (by pbiron):
Replying to [comment:17 desrosj]:
> > shouldn't the $supports arg in the DocBlock for register_post_type()
be updated to describe the new structure?
>
> @pbiron I did think about that. I didn't only because the docs
explicitly mention `Serves as an alias for calling add_post_type_support()
directly.` But more docs wouldn't hurt.
Until I saw this ticket I didn't know that `add_post_type_support()` could
take a 3rd arg (especially since the DocBlock for it doesn't explicitly
mention it, see
[https://developer.wordpress.org/reference/functions/add_post_type_support/
add_post_type_support()])...you have to dig into its source to find the
`array_slice( func_get_args(), 2 )` to figure it out.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40413#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list