#2057 closed defect (bug) (fixed)
Pages with page-linked attachments can't be updated.
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | high | |
| Severity: | major | Version: | 2.0 |
| Component: | General | Keywords: | cache bg|has-patch bg|commit |
| Focuses: | Cc: |
Description
get_post() places pages in $post_cache and ignores the page cache. Therefore a get_post($page_ID) subsequent to a wp_insert_post($page) will return the page object cached by the get_post() call in wp_insert_post(), which was prior to the UPDATE query. This results in an UPDATE reverting the page when saving pages that include links to attachment pages.
What a mouthful.
This patch makes get_post() detect pages and pass their handling to get_page(). Likewise, get_page() is made aware of non-pages and passes their handling to get_post(). This makes the two functions interchangeable and keeps the two caches separate.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
(In [3289]) get_post(), get_page() fixes from skeltoac. fixes #2057