[Resolved] custom fields names not displayed with view’s filter select dropdown
This thread is resolved. Here is a description of the problem and solution.
Problem:
custom fields names not displayed with view's filter select dropdown
Solution:
The default limit to display the custom fields within the filter dropdown select that displays the custom fields names is 512. You can max display 512 custom fields.
we reached the limit of the default number of fields we manage at once. We limit our query to only match the first 512 different fields for our cache. If we reached that limit and your new field is failing to get included, we might need to do some changes in our side to be able to override the limit.
This explain why it was fixed before, after i think having cleaned my database by removing unused metafields
Hello
I have more than 700 metafields, and newly created metafields was nit displayed in Views, even after adding code
wpv_filter_wpv_get_hidden_postmeta_keys_limit
to functions.php
Bur after removing manually some metafields and now i have : 396
Ok - "wpv_filter_wpv_get_hidden_postmeta_keys_limit" is applied to increase the hidden custom field value.
It looks like that view's using cache and this problem is unique and looks like cache issue.
I would like to know - Are you using any third -party cache plugin?
Also, I've consult one of the Dev and he advise that to not to use that many custom fields and remove unwanted custom fields as eventually its not used and if still you need that many custom fields and you want to keep using I would need your site copy with 700+ custom fields added with ACF - that will help our Devs to debug this issue further.
Hello
I'm not using anu cache plugin except soem options at hosting company (please see attached image), I have now diseabled them
Please check now the website, i had already gives you access in this ticket, i have updated to the last version to debug it
(You can do anything, remove, add ... any metafields ...)
I don't know how to find unused metafields to remove them
Please find here an access to database : hidden link
Ok - I've debugged this issue further and found that the limit to display the custom fields is 512 under the dropdown. You can max display 512 custom fields.
If you want to access the newly added fields - you need to update this value by changing the core plugin file (which we do not recommend).
Here is the file path:
plugins\wp-views\embedded\inc\wpv.class.php
Where:
you will find following functions:
- wpv_get_postmeta_keys
- get_meta_keys
You should change the 512 to 700 or 750 or 800.
Ever after doing above change you do not able to see the fields in dropdown option - what you need to do is create one post with newly created fields or update existing post with newly created field value.
I see then I can see the newly crated field within the filter dropdwon.
As this is already a long historical thread and problem was related to how you can increase the fields limit to display - it will be great if you can open a new ticket.