[wp-trac] [WordPress Trac] #40780: Update docblocks & parameters in wp-includes/link-template.php for post-related functions

WordPress Trac noreply at wordpress.org
Sat Jul 1 03:16:07 UTC 2017


#40780: Update docblocks & parameters in wp-includes/link-template.php for post-
related functions
-------------------------------+-------------------
 Reporter:  GunGeekATX         |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  4.9
Component:  Posts, Post Types  |     Version:  4.8
 Severity:  normal             |  Resolution:
 Keywords:  has-patch          |     Focuses:  docs
-------------------------------+-------------------
Changes (by DrewAPicture):

 * keywords:  needs-refresh => has-patch
 * milestone:  Awaiting Review => 4.9


Comment:

 I've iterated the patch with [attachment:40780.diff] in what I think is a
 fair compromise.

 I think we're fine keeping the `$id` parameter since it's so consistent
 between the functions already, but there's definitely value in better
 documenting the types accepted.

 Also, I've gone ahead and kept the suggested use of `$post` for checking
 the post status in `get_post_permalink()` as referencing back to the
 original `$id` parameter several lines after retrieving the full object
 seemed weird. `get_post_status()` can accept an ID or `WP_Post` object
 too, so that's fine.

 Maybe at some later point we should go through and rename all of these
 variables at once, but for the purposes of this ticket, let's keep it
 simple :-)

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


More information about the wp-trac mailing list