Saltar navegación

[Resuelto] Query Filter check if Date was filled in or blank

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

I am trying to use the Views Query filter to check if a Date field was filled in or is blank. What is the best way to check that using the options available in the Query Filter?

Solution:

I suggest you try Views filter hook wpv_filter_query, for example, when user submit the search form, use wpv_filter_query to trigger a PHP function, in this function check the "Date field was filled in or is blank", then do what you want.

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

This support ticket is created hace 6 años. 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Etiquetado: ,

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Mukesh hace 6 años.

Asistido por: Luo Yang.

Autor
Mensajes
#1192316

I am trying to:
I am trying to use the Views Query filter to check if a Date field was filled in or is blank. What is the best way to check that using the options available in the Query Filter?
:

#1192329

Hello,

I suggest you try Views filter hook wpv_filter_query, for example, when user submit the search form, use wpv_filter_query to trigger a PHP function, in this function check the "Date field was filled in or is blank", then do what you want.

See our document:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

You can get the example codes by clicking link "Usage examples"

#1192366

My issue is resolved now. Thank you!