diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index deb215e17d..f621f456ba 100644
--- a/src/wp-includes/post.php
+++ b/src/wp-includes/post.php
@@ -6821,10 +6821,10 @@ function _publish_post_hook( $post_id ) {
  *
  * @since 3.1.0
  *
- * @param int|WP_Post $post Post ID or post object. Defaults to global $post.
+ * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post.
  * @return int|false Post parent ID (which can be 0 if there is no parent), or false if the post does not exist.
  */
-function wp_get_post_parent_id( $post ) {
+function wp_get_post_parent_id( $post = null ) {
 	$post = get_post( $post );
 	if ( ! $post || is_wp_error( $post ) ) {
 		return false;
diff --git a/tests/phpunit/tests/post/wpGetPostParentId.php b/tests/phpunit/tests/post/wpGetPostParentId.php
index fe6eacde38..6906eddcd9 100644
--- a/tests/phpunit/tests/post/wpGetPostParentId.php
+++ b/tests/phpunit/tests/post/wpGetPostParentId.php
@@ -33,6 +33,11 @@ class Tests_Post_WpGetPostParentId extends WP_UnitTestCase {
 		$this->assertSame( self::$parent_post_id, wp_get_post_parent_id( self::$post_id ) );
 	}
 
+	public function test_wp_get_post_parent_id_with_no_post_argument_default_to_global_post_id() {
+		$GLOBALS['post'] = get_post( self::$post_id );
+		$this->assertSame( self::$parent_post_id, wp_get_post_parent_id() );
+	}
+
 	public function test_wp_get_post_parent_id_with_non_existing_id_default_to_global_post_id() {
 		$GLOBALS['post'] = get_post( self::$post_id );
 		$this->assertSame( self::$parent_post_id, wp_get_post_parent_id( 0 ) );
