#15434 closed enhancement (wontfix)
Allow escaped quotes in shortcode atts
Reported by: | mtymek | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Shortcodes | Keywords: | has-patch needs-testing 2nd-opinion |
Focuses: | Cc: |
Description
It would be really helpful for plugin that I'm developing now, if you allowed shortcodes similar to this one:
[my_shortcode param="param with \"escaped\" quotes"]
Attachments (1)
Change History (9)
#3
@
14 years ago
- Milestone changed from Awaiting Review to Future Release
- Type changed from feature request to enhancement
#5
@
12 years ago
Hi. You can use ' that is the HTML entity for single quote in shortcode attributes, if he purpose is to display the value of that shortcode attribute.
Remember that attributes not to be displayed should be intended as variables in a programming Language, so complex strings as value aren't a requirement. It would be bad programming to pass via attributes things like html code (the only one exception would be, for example, for a title attribute to be displayed, in this case you may use html entities as stated before). If you need to pass complex data, pass an id and retrieve data from db/file in the php code...
Regards.
Dr. Marco Marsala
#6
@
12 years ago
- Keywords 2nd-opinion added
- Resolution set to wontfix
- Severity changed from normal to trivial
- Status changed from new to closed
- Version set to 3.5.1
#8
@
12 years ago
- Milestone Future Release deleted
- Severity changed from trivial to normal
- Version 3.5.1 deleted
No traction in 2 years, so I tend to agree with the wontfix.
Another workaround is to use different types of quotes:
[my_shortcode param="param with 'escaped' quotes"] [my_shortcode param='param with "escaped" quotes']
Let's investigate how hard it would be to modify the regex to accommodate this. Seems like a reasonable thing to have.