Navigation überspringen

[Gelöst] Not able to add shortcodes in view query?

This support ticket is created vor 4 Jahren, 9 Monaten. 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)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Kelly vor 4 Jahren, 9 Monaten.

Assistiert von: Minesh.

Author
Artikel
#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

Sprachen: Englisch (English )

Zeitzone: 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: versteckter 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.