Hello, I would like to know why $ title is used on wpt_field_options and not slug?
the slug is unique even with two CPTs instead I can have the same title with 2 different CPTs
Hi, I'm not quite sure why it was decided to use title instead of slug in this API filter, that seems prone to similar title conflicts. This filter is a bit outdated and unreliable, and our developers are likely to remove it soon. If you create a View with custom search and filter by a select field with manipulated options, the options in that front-end filter will not reflect the option changes made with this API filter. It can lead to unexpected results in Views, and there are no known workarounds. We recommend you do not use the wpt_field_options filter, and the documentation includes a relevant warning: https://toolset.com/documentation/programmer-reference/types-api-filters/#wpt_field_options
I would consider the wpt_field_options filter deprecated and avoid using it in your custom code. If you decide to use it anyway, and you are having problems with non-unique field titles, you may need to use an additional conditional to inspect the values in $current_options to determine in which field is the current context.
Thanks Christian, I think this feature is important but it should be done on the slug and not on the title. I hope the plugin will be updated as soon as possible. Thanks