Forums › Forums › Search & Filter Pro › Manually adding multiple values in one post meta
Tagged: post meta
- This topic has 6 replies, 2 voices, and was last updated 6 years, 10 months ago by Anonymous.
-
Anonymous(Private) January 29, 2018 at 2:54 pm #155680
Hi!
I want to manually populate a post meta with multiple numeric values, (to be chosen from on the front end by a multi select combo box) but I can’t seem to figure out how they should be separated for Search&Filter Pro to be able to display them.
My first attempt was to use the ACF plugin with a Select field, which is fine up to 920 different values. I need to be able to add more… (up to a max of 10.000)
ACF creates a value along this line:
a:3:{i:0;s:1:”VALUE”;i:1;s:1:”VALUE”;i:2;s:1:”VALUE”;}
I was hoping that it could be a tat simpler like 1,2,3,4 or 1|2|3|4 but I am having no succes ๐
Any help or suggestion is greatly appreciated!
Trevor(Private) January 29, 2018 at 3:27 pm #155731The format you posted:
a:3:{i:0;s:1:"VALUE";i:1;s:1:"VALUE";i:2;s:1:"VALUE";}
Is what windows, and Search & Filter therefore, uses to store arrays in post meta. So it is not possible to use your simpler code suggestions.
It is possible that you are limited by maximum string lengths allowed by your server, in PHP or a host imposed limit (as WP Engine does for example).
Anonymous(Private) January 30, 2018 at 11:08 am #155947Hey Trevor, thanks for the reply!
I figured out my problem, it was indeed the maximum string length that was causing the issue.
Simply adding the line: php_value max_input_vars 9000 to my .htaccess enabled me to select the amount I need.Now I also understand the way the array was build, and am able to do this myself correctly.
Unfortunately I run into a different issue now, everything is working but the search form loads very slowly due to there being so many choices. Any idea what I could do to improve the speed? Once the page is loaded everything works as fast as should (should I open a different ticket?).
-
AuthorPosts