Forums › Forums › Search & Filter Pro › Default Value for Select Option for Custom Field
Tagged: custom field, default value
- This topic has 1 reply, 2 voices, and was last updated 7 years, 8 months ago by Trevor.
-
Anonymous(Private) March 4, 2017 at 10:34 am #94513
Hello,
I have question about working with Custom field. The first I a have to thank you for your great plugin. I really like it. However, I wonder if it is possible to show the default value from custom field (ACF)?
For example my field is : Product Type (as an select field), and this value has only 1 option to choose, so that mean this field will has only 1 value.
So, Instead of the filter dropdown that now it is showing “All items”. Can I change to display only that value from the custom field?
I hope you understand what I am talking about 🙂
You can check my demo page : https://buksohn.com/2017/eginter/result-for-mccb-gt-ac
and see the filter “Product Code” that for now I have only one value, “Ex9M”. So, I want to show this Ex9M instead of showing word “All items”.Thank you,
Trevor(Private) March 4, 2017 at 11:42 am #94514Hi
This has been asked for before, so it IS something we may be considering for a future release, but is not included in the plugin at this time. It is possible to do this using custom javascript (but I do not have any examples that I can give you). Also, the code would have to check if the field already has a setting before changing it.
However, will it always have only one value available, or is this only for now? If it will only ever have one value, so that in the posts the field is either empty or has that one value, then there is no need to have the field in the form, instead you can set this on the Post Meta settings tab as a condition. This would then exclude all posts that did not have that one value or where that field was empty.
-
AuthorPosts