diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php
index 808e491349..e3a1023851 100644
a
|
b
|
function wp_list_post_revisions( $post_id = 0, $type = 'all' ) { |
1957 | 1957 | echo $rows; |
1958 | 1958 | echo '</ul>'; |
1959 | 1959 | } |
| 1960 | |
| 1961 | /** |
| 1962 | * Retrieve the parent post object. |
| 1963 | * |
| 1964 | * @since 5.7.0 |
| 1965 | * |
| 1966 | * @param int|WP_Post|null $post_id Optional. Post ID or post object. |
| 1967 | * |
| 1968 | * @return WP_Post Parent post object. |
| 1969 | */ |
| 1970 | function get_post_parent( $post_id = null ) { |
| 1971 | $post = get_post( $post_id ); |
| 1972 | return ! empty( $post ) ? $post : null; |
| 1973 | } |
| 1974 | |
| 1975 | /** |
| 1976 | * Whether the post has a parent post. |
| 1977 | * |
| 1978 | * @since 5.7.0 |
| 1979 | * |
| 1980 | * @param int|WP_Post|null $post_id Optional. Post ID or post object. |
| 1981 | * |
| 1982 | * @return bool True is the post has a parent post, false otherwise. |
| 1983 | */ |
| 1984 | function has_post_parent( $post_id = null ) { |
| 1985 | return (bool) get_post_parent( $post_id ); |
| 1986 | } |