#37304 closed enhancement (fixed)
Allowing use of single quotes for shortcode empty value attributes
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Shortcodes | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
Recently I created a shortcode allowing empty value attributes.
An user added an empty attribute by surrounding it with single quotes, for example:
[my_shortcode 'foo']Lorem ipsum...[/my_shortcode]
I was surprised that the returned attribute still contains single quotes (for the empty value attributes, the double quotes are stripped instead).
Even if, of course, this is not a bug, I made a patch allowing also using single quotes for shortcode empty value attributes.
Regards
Attachments (5)
Change History (18)
#6
@
8 years ago
Hi @swissspidy, I just updated phpunit tests with those of #32172. I also added a more complete qunit test with mxed attributes.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
#8
@
8 years ago
- Milestone changed from 4.8 to 4.8.1
I feel like this needs to soak in trunk for some time before going into a release.
Some more eyes on the patch would be helpful.
This ticket was mentioned in Slack in #core by enrico.sorcinelli. View the logs.
8 years ago
#12
@
8 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 41026:
#13
@
8 years ago
On the off chance that this causes unit test failures for any other plugins, here's how we resolved it in Jetpack: https://github.com/Automattic/jetpack/pull/7473/files props @kraftbj
Updated