vincentR-2
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Dynamic script tag src URL parameter set by custom numeric field
1
2
Started by: vincentR-2
in: Toolset Professional Support
Problem: I need to add a script tag to my Custom Template. In the script tag's src attribute, I would like to append a URL variable and value coming from a custom field, but I cannot get the Types numeric field shortcode to work correctly. The shortcode is written out in the src URL instead of being executed. I need to add the custom field's numeric value in a URL parameter attached to the src URL. Solution: It turns out that WordPress does not execute shortcodes in script tags URL parameters, whether or not Toolset is involved.Thi p The same problem can be seen even if custom shortcodes are use i . The solution in this case is to get the value of the custom field using the types_render_field API, then append that value to the src attribute URL using a custom shortcode. Relevant Documentation: |
|
2 | 20 | 3 years, 10 months ago |