[wp-trac] [WordPress Trac] #40413: Handle `register_post_type` support's array

WordPress Trac noreply at wordpress.org
Tue Sep 17 17:58:45 UTC 2019


#40413: Handle `register_post_type` support's array
--------------------------------------------------+------------------------
 Reporter:  MaximeCulea                           |       Owner:  desrosj
     Type:  enhancement                           |      Status:  reviewing
 Priority:  normal                                |   Milestone:  5.3
Component:  Posts, Post Types                     |     Version:  2.9
 Severity:  normal                                |  Resolution:
 Keywords:  has-patch has-unit-tests 2nd-opinion  |     Focuses:
--------------------------------------------------+------------------------
Changes (by desrosj):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests 2nd-
               opinion


Comment:

 This looks good! The only thing that I am torn on is the variable names.

 `add_post_type_support()`'s documented parameters are `$post_type,
 $feature, $args`, but [attachment:"ticket-40413.2.patch"] names the
 variables in a way that feels like they are passed in reverse.

 [attachment:"40413.diff"] switches the names, but I am not sure that it
 makes things clearer because when `$args` is not an array, it is passed as
 `$feature`. I don't have a strong opinion either way, but any feedback
 would be appreciated.

 Also in [attachment:"40413.diff"]:
 - Coding standards fixes in the test changes.
 - Added the `@ticket` tag to the new test function.

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


More information about the wp-trac mailing list