[wp-trac] [WordPress Trac] #48358: wp_get_post_parent_id() does not default to global $post
WordPress Trac
noreply at wordpress.org
Wed Nov 17 03:23:55 UTC 2021
#48358: wp_get_post_parent_id() does not default to global $post
-------------------------------------------------+-------------------------
Reporter: danielpost | Owner:
| SergeyBiryukov
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 5.9
Component: Posts, Post Types | Version: 3.1
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests needs-dev- | Focuses:
note commit |
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):
* status: reviewing => closed
* resolution: => fixed
Comment:
In [changeset:"52194" 52194]:
{{{
#!CommitTicketReference repository="" revision="52194"
Posts, Post Types: Use global post as the default for
`wp_get_post_parent_id()`.
Convert the `$post` parameter of `wp_get_post_parent_id()` to optional,
defaulting to the current global post object when called within the loop.
Props danielpost, davidbaumwald, SergeyBiryukov, birgire, audrasjb,
hellofromTonya, TimothyBlynJacobs.
Fixes #48358.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48358#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list