Skip Navigation

[Resolved] Shortcode Field Filter Not Working

This thread is resolved. Here is a description of the problem and solution.

Problem:

What dose the option "Shortcode attribute" in screenshot mean:

https://cdn.toolset.com/wp-content/uploads/2019/03/1217223-Screen_Shot_2019_03_19_at_11.11.45_AM.png?x12434

Solution:

The option "Shortcode attribute" in your screenshot means attribute of shortcode [wpv-view].

Relevant Documentation:

https://toolset.com/documentation/user-guides/passing-arguments-to-views/#accessing-the-arguments

This support ticket is created 5 years, 8 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

This topic contains 2 replies, has 2 voices.

Last updated by Sean 5 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1217223
Screen Shot 2019-03-19 at 11.11.45 AM.png

Users submit applications through my site. When they do so, I mark each one with the current year (as a single line custom field):

[cred_field field='application-year' post='candidate' value='[currentyear]' urlparam='' class='form-control' output='bootstrap']

Where [currentyear] is a custom shortcode that runs: echo date("Y");

When I create a view and want to filter by the year, I do the following (screenshot attached):

Only that doesn't work. Am I getting the syntax wrong?

I already know a workaround to get the same result, but I can see myself needing something like this in the future, so would like to understand how it's supposed to work.

#1217391

Hello,

The option "Shortcode attribute" in your screenshot means attribute of shortcode [wpv-view], for example:

[wpv-view name="MY-VIEW-NAME" currentyear="2019"]

See our document
https://toolset.com/documentation/user-guides/passing-arguments-to-views/#accessing-the-arguments
section "Accessing the arguments"

#1219336

Ah, that makes sense. Thanks.