wp-includes/post-template.php:2099Returns whether the given post has a parent post.
$postint|WP_Post|nulloptionalnullboolfunction has_post_parent( $post = null ) { return (bool) get_post_parent( $post );}Introduced in 5.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/post-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.