Forums › Forums › Search & Filter Pro › Caching and Custom Post Types in 2.0
Tagged: cache, custom post types
- This topic has 2 replies, 2 voices, and was last updated 9 years, 1 month ago by Ross.
-
Anonymous(Private) October 2, 2015 at 6:57 pm #26410
Hi,
We upgraded to 2.0 and works great except new posts will only appear in results if we manually rebuild the cache.
More information: We are exclusively using a custom post type. We create posts using an ACF front-end form. They are created as drafts, then published both via front end and/or back end methods. New posts won’t appear in results unless we manually re-build the cache in the S&F back end.
Search settings: only searching our custom post type. Display results as an archive using custom template. Everything worked fine in previous versions.
Any ideas? Thanks for your help.
Anonymous(Private) October 2, 2015 at 7:09 pm #26411Quick update. Might be related to the way we publish on the front end. Authors can publish on the front end which always uses the wp_update_post() function (not wp_publish_post as recommended by the Codex). If we go into the back end and update the post manually they will appear in search results right away.
We’ll continue to investigate — but perhaps it’s just that posts are not added to the cache when using wp_update_post() method?
Ross Moderator(Private) October 5, 2015 at 9:33 am #26494Hey Dan
Good catch.
Yeah I was thinking there will probably be circumstances where people are updating posts or the posts table without using the “proper” WP hooks –
I’ll have a look to see if its something I can hook into, alternatively I should be able to make a method which allows you to update the cache for a particular post programatically – so it would be a case of adding a line of code to your theme/plugin somewhere.
Thanks
-
AuthorPosts