Skip Navigation

[Resolved] wpt_field_options title and slug

This support ticket is created 3 years, 7 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 3 voices.

Last updated by andreaD-4 3 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#2007423

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

#2007829

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.

#2010325

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

#2013865

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Andrea,

As Christian is currently on vacation at this Time I will be handling this ticket for him.

Based on the responses in thread there isn't anything else that I can do as Christian already explained.

Can we mark this one as resolved?

Thanks,
Shane

#2013867

My issue is resolved now. Thank you!