Returns whether the given post has a parent post.
function has_post_parent( $post = null ) {
return (bool) get_post_parent( $post );
}
| Version | Description |
|---|---|
| 5.7.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/has_post_parent