Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 3 years ago

#9045 closed defect (bug) (invalid)

allow shortcode to accept unpaired attributes

Reported by: hailin Owned by: hailin
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:


Current shortcode doesn't allow format such as: [shortcode ryan loc=vt s=poet] which contains unpaired attr

there are many cases where some attrs don't have names - so with current shortcode req, we can not use it, and it creates other issues: in wp_trim_excerpt we strip_shortcodes, but we left out some because not all shortcodes can be added in the first place, causing issues in tag, or excepts.

I propose to assign default numeric index to unpaired attributes.

Attachments (1)

9045_shortcode.diff (1.5 KB) - added by hailin 9 years ago.

Download all attachments as: .zip

Change History (5)

9 years ago


#1 @hailin
9 years ago

  • Owner changed from anonymous to hailin
  • Status changed from new to assigned

#2 @hailin
9 years ago

current API only support an edge case: [shortcode 123], it does not support more complext case, such as [shortcode 123 456] or [shortcode 123 foo=bar] [shortcode foo=bar i=300 123 456 test=iou]

My patch supports all those cases.

#3 @hailin
9 years ago

  • Resolution set to invalid
  • Status changed from assigned to closed

oops, my bad. I underestimated the long reg ex. the old one can handle the complex cases.

#4 @DrewAPicture
3 years ago

  • Milestone 2.8 deleted
Note: See TracTickets for help on using tickets.