Skip to content

Variable usage: Confused! #92

Answered by TheHorscht
bruibbruib asked this question in Q&A
Discussion options

You must be logged in to vote

It's because inner shortcodes are processed before outer shortcodes, which is mentioned in the manual under "Understanding the Processing Chain".
So in your case, [choose][file prompt1]|[file prompt2][/choose] expands to:
[choose] prompt1[set "col"]blue[/set] | prompt2[set "col"]yellow[/set] [/choose]
which in turn executes both [set] in sequence before [choose].
To solve this, use {} instead of [] for file:
[choose]{file prompt1}|{file prompt2}[/choose]

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bruibbruib
Comment options

Answer selected by bruibbruib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants