#2057 closed defect (bug) (fixed)
Pages with page-linked attachments can't be updated.
| Reported by: | skeltoac | Owned by: | ryan |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | General | Version: | 2.0 |
| Severity: | major | Keywords: | cache bg|has-patch bg|commit |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
(In [3289]) get_post(), get_page() fixes from skeltoac. fixes #2057