[wp-trac] [WordPress Trac] #56243: Use a consistent parameter name for functions accepting a post ID or post object
WordPress Trac
noreply at wordpress.org
Mon Jul 18 17:33:38 UTC 2022
#56243: Use a consistent parameter name for functions accepting a post ID or post
object
------------------------------------+--------------------
Reporter: SergeyBiryukov | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.1
Component: Posts, Post Types | Version:
Severity: normal | Keywords:
Focuses: docs, coding-standards |
------------------------------------+--------------------
Most functions that accept a post ID or post object use `$post` as the
parameter name.
* Some functions use `$post_id` or just `$id`, which should be renamed to
`$post`.
* Some functions can accept a `WP_Post` object, but it's not explicitly
documented:
* `get_the_category()`
* `get_the_category_list()`
* `the_category()`
* `get_the_tag_list()`
* `get_the_term_list()`
* `the_terms()`
This ticket aims to bring some consistency.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56243>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list