Forums › Forums › Search & Filter Pro › ACF Relationship filter displays IDs instead of labels
Tagged: acf, custom fields, custom post type, label, relationship
- This topic has 2 replies, 2 voices, and was last updated 6 years, 10 months ago by Trevor.
-
Anonymous(Private) January 17, 2018 at 7:47 am #152962
Hi.
First off, I’d like to compliment you on your great Plugin, I love it.
Since recently I am experiencing a strange bug, though. Here is the wrapupSummary: I have two CPTs, one of which has a custom field (implemented using the AFC plugin) relating it to the other. On one page I am using a filter where I can filter the one post type by the other (see here, ‘Anwendung’ is the post type by which I want to filter the ones on the right). Since recently the filter is not displaying correctly: Instead of displaying the labels of the post type by which I want to filter, it displays their IDs. I can not pinpoint exactly when this started, but I believe it was shortly after I installed Relevansii. However, disabling Relevanssi (and all other Plugins) did not resolve the issue.
What I expected to see: The labels of the posts of the CPT in the filter.
What I did see: The IDs of the posts.
WordPress Version: 4.9.2
Theme: Jupiter v6.0.1 with a child theme
ACF plugin version: 4.4.12 + Advanced Custom Fields Multilingual
S&F Pro version: 2.3.4
I know there are numerous posts in this forum which are similar, but they either do not describe the same problem or the answers which seem to have helped are marked as private. That is why I am posting this.
Thank you very much in advance for your help.
Anonymous(Private) January 17, 2018 at 8:21 am #152964Update: I was able to fix the issue. This is what I did:
1. Run this SQL-query:DELETE FROM \
wp_search_filter_cache\WHERE \
field_name\= '_sfm_[name of the post type by which I want to filter]'
.2. In the search form, set the meta-key to something different and save.
3. In the search form, set the meta-key back to its original value and save.
I believe this was an issue with the S&F cache. It would be great to have the option to clear the cache in the backend.
Trevor(Private) January 17, 2018 at 10:52 am #152989Thanks for sharing. Our forum software made a mess of the code snippet though, so I made a GIST of it:
https://gist.github.com/CotswoldPhoto/0afae1b95556059af1b0ce53531c26d9
Note that the name of the table may be different if you use a prefix for tables.
-
AuthorPosts