Make WordPress Core

Opened 16 years ago

Closed 13 years ago

Last modified 13 years ago

#15434 closed enhancement (wontfix)

Allow escaped quotes in shortcode atts

Reported by: mtymek Owned by:
Priority: normal Milestone:
Component: Shortcodes Version:
Severity: normal Keywords: has-patch needs-testing 2nd-opinion
Cc: Focuses:

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)

wordpress_#15434.patch (1.5 KB ) - added by rbachlec 15 years ago.
Patch for escaping quotes and apostrophes in shortcode attribute values.

Download all attachments as: .zip

Change History (9)

#1 @scribu
16 years ago

  • Type feature requestenhancement

#2 @markjaquith
16 years ago

  • Type enhancementfeature request

Let's investigate how hard it would be to modify the regex to accommodate this. Seems like a reasonable thing to have.

#3 @markjaquith
16 years ago

  • Milestone Awaiting ReviewFuture Release
  • Type feature requestenhancement

#4 @rbachlec
15 years ago

  • Keywords has-patch needs-testing added

@rbachlec
15 years ago

Patch for escaping quotes and apostrophes in shortcode attribute values.

#5 @networksolution
13 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

Last edited 13 years ago by SergeyBiryukov (previous) (diff)

#6 @networksolution
13 years ago

  • Keywords 2nd-opinion added
  • Resolutionwontfix
  • Severity normaltrivial
  • Status newclosed
  • Version3.5.1

#7 @networksolution
13 years ago

  • Cc networksolution added

#8 @SergeyBiryukov
13 years ago

  • Milestone Future Release
  • Severity trivialnormal
  • Version 3.5.1

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']
Note: See TracTickets for help on using tickets.