Skip Navigation

[Resolved] Is there documentation for Select field option 'Get options from a shortcode' ?

This support ticket is created 4 years, 4 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
- 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/Karachi (GMT+05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by robertA-11 4 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2030343
Screenshot_1.png

Hello,

Is there any documentation on how to use 'Get options from a shortcode' with a select field on a form? I have searched the support site but I cannot find any documentation. Ultimately what I'm trying to do is populate the dropdown list with values.

Many thanks
Rob

#2030587

Hi Rob,

Thank you for contacting us and I'd be happy to assist.

To use the 'Get options from a shortcode' in a generic field, you just need to create a custom shortcode that can return the option titles and values in this JSON object format:


{"value": "value1", "label": "Label 1"}, {"value": "value2", "label": "Label 2", "default": true}

You'll find a good usage example of a custom shortcode for this, in this reply:
https://toolset.com/forums/topic/split-publishing-related-many-to-many-posts/#post-1215323

That shortcode gets all the posts from the "qualification" custom post type and returns the post titles and IDs as options titles and values.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2031119

Hello Waqar,

Thank you for your quick support. The information you provided was useful, but I've decided to use a different method for my particular task.

Kind Regards
Rob