Posts, Post Types: Rename the new post parent conditional tag functions for clarity.
* `get_parent_post()` becomes `get_post_parent()` * `has_parent_post()` becomes `has_post_parent()` Props johnjamesjacoby, SergeyBiryukov, lukecarbis, peterwilsoncc Fixes #33045 Built from https://develop.svn.wordpress.org/trunk@50396 git-svn-id: http://core.svn.wordpress.org/trunk@50007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
391fc25eed
commit
eac91ec9c5
|
@ -1972,7 +1972,7 @@ function wp_list_post_revisions( $post_id = 0, $type = 'all' ) {
|
||||||
* @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global $post.
|
* @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global $post.
|
||||||
* @return WP_Post|null Parent post object, or null if there isn't one.
|
* @return WP_Post|null Parent post object, or null if there isn't one.
|
||||||
*/
|
*/
|
||||||
function get_parent_post( $post = null ) {
|
function get_post_parent( $post = null ) {
|
||||||
$wp_post = get_post( $post );
|
$wp_post = get_post( $post );
|
||||||
return ! empty( $wp_post->post_parent ) ? get_post( $wp_post->post_parent ) : null;
|
return ! empty( $wp_post->post_parent ) ? get_post( $wp_post->post_parent ) : null;
|
||||||
}
|
}
|
||||||
|
@ -1985,6 +1985,6 @@ function get_parent_post( $post = null ) {
|
||||||
* @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global $post.
|
* @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global $post.
|
||||||
* @return bool Whether the post has a parent post.
|
* @return bool Whether the post has a parent post.
|
||||||
*/
|
*/
|
||||||
function has_parent_post( $post = null ) {
|
function has_post_parent( $post = null ) {
|
||||||
return (bool) get_parent_post( $post );
|
return (bool) get_post_parent( $post );
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.7-beta3-50395';
|
$wp_version = '5.7-beta3-50396';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue