WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#19059 closed defect (bug) (invalid)

Shortcodes starting with "embed_" doesn't always get called

Reported by: belx Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Plugins Keywords:
Focuses: Cc:

Description

WP_Embed unregisters all filters before it runs, and because of how the shortcode regex is written,

(.?)\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)

where $tagregexp is defined as

$tagregexp = join( '|', array_map('preg_quote', $tagnames) );    

embed_page is matched against /(embed)\b/, and removes the shortcode from the content.

by changing \b to a list of characters that should be matched, shortcodes staring with "embed_" will be working again.

[ \/\]] instead of \b should work

that is, use these characters as boundary: " ", "/", and "]"

The regexp is taken from an earlier version than trunk, but the \b (and bug) is still present.

Change History (3)

comment:1 @belx3 years ago

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

comment:2 @SergeyBiryukov3 years ago

  • Milestone Awaiting Review deleted

comment:3 @SergeyBiryukov3 years ago

I've just tested a sample function hooked to embed_page shortcode in 3.3-beta2-19067, and it seems to work.

Note: See TracTickets for help on using tickets.