Pages with page-linked attachments can't be updated.
|Reported by:||skeltoac||Owned by:||ryan|
|Component:||General||Keywords:||cache bg|has-patch bg|commit|
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.