Skip Navigation

[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.

If you want to change the default limit - You can find proposed solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/search-files-attached-to-a-post-type/page/2/#post-626179

Relevant Documentation:

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 30 replies, has 3 voices.

Last updated by bouchairY 6 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#625046

Hello
How can I add metafields direcly to WordPress without enabling types plugin ?
Thank you

#625048
#625083
#625100

Hello
I think the problem is due to :

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

How we can pass the limitation of 512 ?

Thank you

#625392

Okay I was not aware of this, and another supporter just supplied this undocumented filter for you to try:

add_filter( 'wpv_filter_wpv_get_hidden_postmeta_keys_limit', 'prefix_increase_views_hidden_custom_fields_limit' );
function prefix_increase_views_hidden_custom_fields_limit( $limit = 512 ) {
    return 1024;
} 

This should double the 512 limit, I wasn't aware we imposed that in code.

#625656

Hello
Thank you for the shortcode

Seems not working for the moment, is there any cache to delete ?

Thank you

#625984

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

The newly created metafields are displayed !!

Are you sure that the code provided is working ?

Thank you

#626090

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

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.

#626108
cache.jpg

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

Thank you for your help

#626114

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

It will be great if you can send me copy of your site using duplicator plugin.

More info:
https://toolset.com/faq/provide-supporters-copy-site/

I have set the next reply to private which means only you and I have access to it.

#626116

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - its fine as images are not needed here.

I have set the next reply to private which means only you and I have access to it.

#626119

Hello
You will find uplicator files in

/travellerorg/DUPLI CATOR directory

Thank you

#626179

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

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.

#626411

Hello
Thank you it is working now

I need help to the first request of this ticket :

I want to make a custom search by words in files title and display correspondant offers

I have a workaround, do you I have to open a new ticket or we can continue on this one ?

Thank you in advance

#626418

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

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.