WordPress.org

Make WordPress Core

Changeset 42397


Ignore:
Timestamp:
12/15/2017 01:01:01 AM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r42383 r42397  
    62526252
    62536253/**
    6254  * Return the post's parent's post_ID
     6254 * Return the post's parent post ID.
    62556255 *
    62566256 * @since 3.1.0
    62576257 *
    6258  * @param int $post_ID
    6259  *
     6258 * @param int|WP_Post $post Post ID or post object. Defaults to global $post.
    62606259 * @return int|false Post parent ID, otherwise false.
    62616260 */
    6262 function wp_get_post_parent_id( $post_ID ) {
    6263     $post = get_post( $post_ID );
     6261function wp_get_post_parent_id( $post ) {
     6262    $post = get_post( $post );
    62646263    if ( ! $post || is_wp_error( $post ) ) {
    62656264        return false;
Note: See TracChangeset for help on using the changeset viewer.