How do I pluralize this? [as what="firstname" default="Your"] where I want (Chad's) or (Your). Would this work? [as what="firstname" "'s" default="Your"]
At first, I thought it might be possible to combine two shortcodes like this: [as what="firstname" default="Your" /][block field="Name"]'s[/block], but block checks against a specific value, not a generic "is set".
We could add another attribute to add the extra content when the merge is there.
as
what= The field
default= display this when field is empty
append= add this to the end when variable is set
prepend= add this to the beginning when variable is set
[as prepend="Hi " what="firstname" append="!" default="Hello friend," /]
Output when Name not set:
Hello friend,
Output when Name is set (Chad):
Hi Chad!
The ability to prepend wasn't asked for, but I think prepend and append go well together.
From the Facebook group:
At first, I thought it might be possible to combine two shortcodes like this:
[as what="firstname" default="Your" /][block field="Name"]'s[/block]
, butblock
checks against a specific value, not a generic "is set".We could add another attribute to add the extra content when the merge is there.
as
what=
The fielddefault=
display this when field is emptyappend=
add this to the end when variable is setprepend=
add this to the beginning when variable is setThe ability to prepend wasn't asked for, but I think prepend and append go well together.