Forums Forums Search & Filter Pro Rebuild Cache from Code

Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #266664

    Hello,

    do_action('search_filter_update_post_cache', $post_id); – this clears thee cache of a particular post.
    But how can I rebuilt the cache of a search form (I am talking about the “rebuild cache” option on the search form edit screen) from code?

    Thanks.

    Trevor
    #266685

    There is no option or code to do this, sorry. Are you needing to do this after an import update of posts, such as when using WP All Import?

    For example, with WP All Import, see this post:

    https://support.searchandfilter.com/forums/topic/cache-at-time-interval/

    Anonymous
    #266690

    It’s not actually a post import. I am manually updating some post meta, based on some user activities, and I need to update the cache after it saves the post meta values. Without rebuilding the cache, filter result doesn’t update according with the new meta values.

    Trevor
    #266692

    If you are saving the data when editing a post, our cache should automatically update when you press the Update button for the post. Is it not doing that?

    Anonymous
    #266694

    I am updating the post from code.

    Trevor
    #266698

    From PHP or SQL?

    Anonymous
    #266703

    Using wp_update_post and update_post_meta.

    Trevor
    #266705

    Then you will need to update the data per post, using the code you first posted, by adding that to your code.

Viewing 8 posts - 1 through 8 (of 8 total)