Skip Navigation

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

This support ticket is created 3 years, 11 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
- 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)

This topic contains 2 replies, has 2 voices.

Last updated by Kelly 3 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#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
Supporter

Languages: English (English )

Timezone: 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: hidden link

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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.