Opened 17 years ago
Closed 16 years ago
#10350 closed defect (bug) (worksforme)
post_parent returns 0 even when post is revised to give a parent
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | low | |
| Severity: | normal | Version: | 2.8 |
| Component: | General | Keywords: | reporter-feedback |
| Focuses: | Cc: |
Description
I've added <?php echo $post->post_parent; ?> to a page and it shows 0 when on homepage (as expected). It shows 14 when on a subpage of 14, but on a different sub-page of 14 it shows 0. It seems it's getting the original parent before the page was revised to be a subpage of 14.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Does it occur under the default theme with all plugins disabled?
Seems pretty unlikely WordPress would even render the object if the parent was set incorrectly at parsing time.. (but possible)