[wp-trac] [WordPress Trac] #34234: Rename `id` param in get_the_permalink, get_permalink, and the_permalink

WordPress Trac noreply at wordpress.org
Sat Oct 10 05:40:16 UTC 2015


#34234: Rename `id` param in get_the_permalink, get_permalink, and the_permalink
----------------------------+---------------------------
 Reporter:  chriscct7       |       Owner:  DrewAPicture
     Type:  task (blessed)  |      Status:  accepted
 Priority:  normal          |   Milestone:  4.4
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  template
----------------------------+---------------------------

Comment (by DrewAPicture):

 In [changeset:"35001"]:
 {{{
 #!CommitTicketReference repository="" revision="35001"
 Template: Rename the `$id` parameters in `the_permalink()`,
 `get_the_permalink()`, and `get_permalink()` to `$post`.

 In all three cases, the functions can accept a post ID, a `WP_Post`
 object, or a falsey value, which defaults to the value of the global
 `$post`. Switching to `$post` in this context allows the parameters to
 better self-document and removes ambiguity in the code they are
 subsequently used in.

 Props chriscct7 for the initial patch.
 See #34234.
 }}}

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


More information about the wp-trac mailing list