IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
1737 | 1737 | echo $rows; |
1738 | 1738 | echo "</ul>"; |
1739 | 1739 | } |
| 1740 | |
| 1741 | /** |
| 1742 | * Retrieve the parent post ID. |
| 1743 | * |
| 1744 | * @since 4.5.0 |
| 1745 | * |
| 1746 | * @param int|WP_Post|null $post_id Optional. Post ID or post object. |
| 1747 | * |
| 1748 | * @return int |
| 1749 | */ |
| 1750 | function wp_get_post_parent( $post_id = null ) { |
| 1751 | $post = get_post( $post_id ); |
| 1752 | |
| 1753 | if ( empty( $post ) ) { |
| 1754 | return 0; |
| 1755 | } |
| 1756 | |
| 1757 | return $post->post_parent; |
| 1758 | } |
| 1759 | |
| 1760 | /** |
| 1761 | * Whether the post has a parent post. |
| 1762 | * |
| 1763 | * @since 4.5.0 |
| 1764 | * |
| 1765 | * @param int|WP_Post|null $post_id Optional. Post ID or post object. |
| 1766 | * |
| 1767 | * @return int |
| 1768 | */ |
| 1769 | function has_post_parent( $post_id = null ) { |
| 1770 | return (bool) wp_get_post_parent( $post_id ); |
| 1771 | } |
| 1772 | No newline at end of file |