mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Docs: Add missing parameter description in wp_get_post_parent_id()
function DocBlock.
Rename `$post_ID` to `$post` for consistency with other functions. Add unit tests for `wp_get_post_parent_id()`. Props keesiemeijer. Fixes #42797. Built from https://develop.svn.wordpress.org/trunk@42397 git-svn-id: http://core.svn.wordpress.org/trunk@42226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
faa04cf9b3
commit
0d09b75c4b
@ -6251,16 +6251,15 @@ function _publish_post_hook( $post_id ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the post's parent's post_ID
|
* Return the post's parent post ID.
|
||||||
*
|
*
|
||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
*
|
*
|
||||||
* @param int $post_ID
|
* @param int|WP_Post $post Post ID or post object. Defaults to global $post.
|
||||||
*
|
|
||||||
* @return int|false Post parent ID, otherwise false.
|
* @return int|false Post parent ID, otherwise false.
|
||||||
*/
|
*/
|
||||||
function wp_get_post_parent_id( $post_ID ) {
|
function wp_get_post_parent_id( $post ) {
|
||||||
$post = get_post( $post_ID );
|
$post = get_post( $post );
|
||||||
if ( ! $post || is_wp_error( $post ) ) {
|
if ( ! $post || is_wp_error( $post ) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-alpha-42396';
|
$wp_version = '5.0-alpha-42397';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
Block a user