Saltar navegación

[Resuelto] Not able to add shortcodes in view query?

This support ticket is created hace 4 años, 11 meses. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Etiquetado: ,

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Kelly hace 4 años, 11 meses.

Asistido por: Minesh.

Autor
Mensajes
#1639081

I'm attempting to limit a view by using a post meta item. I've selected it from the query dropdown and I'm trying to add the shortcode I want it to test against. Pasted from the form:

Field - _private_page_userid_dropdown
The field _private_page_userid_dropdown is a number that is equal to the following:

Shortcode attribute : [wpv-user field="ID"]

but I get this error:
"Only lowercase letters and numbers allowed as shortcode attributes"

Am I being daft?

#1639823

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

When you add a custom field query filter to filter your view by shortcode attribute, you need to pass the shortcode attribute to view.

For example:

[wpv-view name="your-view-slug" userid=" [wpv-user field='ID']"]

Where:
- Replace your-view-slug with your original view slug
- with custom field query filter where you add the query filter to filter by shortcode attribute add the value userid. Please check the following screenshot: enlace oculto

More info:
=> https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes

This is how view's shortcode attribute works. Please let me know if you have any other queries.

#1639907

Great! That did it.