WordPress.org

Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#6606 closed enhancement (fixed)

Pass tag name when using shortcodes

Reported by: Viper007Bond Owned by: tellyworth
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: has-patch 2nd-opinion
Focuses: Cc:

Description

As far as I can tell, there's no way to know what tag a shortcode function is currently handling. This means one function can't handle multiple tags without the tags using wrapper functions to pass the tag.

Attached is a patch that passes the tag.

Suggested for 2.5.1 as well.

Attachments (3)

6606.patch (584 bytes) - added by Viper007Bond 14 years ago.
6606.2.patch (581 bytes) - added by Viper007Bond 14 years ago.
Pass a blank string rather than FALSE for the content
6606.3.patch (583 bytes) - added by Viper007Bond 14 years ago.
Duh, no, pass NULL since it's not set. A blank string would be for [tag]tag.

Download all attachments as: .zip

Change History (7)

@Viper007Bond
14 years ago

#1 @Viper007Bond
14 years ago

I meant "This means one function can't handle multiple tags without the tags going through wrapper functions first to pass the tag name to the main function."

@Viper007Bond
14 years ago

Pass a blank string rather than FALSE for the content

@Viper007Bond
14 years ago

Duh, no, pass NULL since it's not set. A blank string would be for [tag]tag.

#2 @ryan
14 years ago

  • Owner changed from anonymous to tellyworth

#3 @mdawaffe
13 years ago

  • Milestone changed from 2.9 to 2.7

+1

#4 @ryan
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [8613]) Pass tag name when using shortcodes. Props Viper007Bond. fixes #6606

Note: See TracTickets for help on using tickets.