WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 2 months ago

#6984 new defect (bug)

wpautop() formats the the contents of shortcodes

Reported by: Viper007Bond Owned by:
Milestone: Future Release Priority: low
Severity: normal Version: 2.6
Component: Formatting Keywords: needs-patch wpautop
Focuses: Cc:

Description

wpautop(), the bane of my existence as a plugin developer, is at it again.

Here's an example of some PHP wrapped in a valid shortcode in a post of mine:

[code lang="php"]$text = str_replace( array('<p><p>', '</p></p>'), array('<p>', '</p>'), $text);[/code]

The content that gets passed to my shortcode function is this:

$text = str_replace( array('
<p>', '</p>

</p>
<p>'), array('
<p>', '</p>
<p>'), $text);

Expected result: it shouldn't touch the insides of valid shortcodes (like adding line breaks or anything as it is doing now).

Change History (10)

comment:2 ryan5 years ago

  • Milestone changed from 2.7 to 2.8

comment:3 ryan5 years ago

  • Component changed from General to Formatting
  • Owner anonymous deleted

comment:5 Denis-de-Bernardy5 years ago

  • Milestone changed from 2.8 to Future Release

comment:7 Denis-de-Bernardy5 years ago

  • Milestone changed from Future Release to 2.9

comment:8 azaozz4 years ago

  • Milestone changed from 2.9 to Future Release
  • Priority changed from normal to low
  • Severity changed from normal to trivial

Extreme edge case. The shortcode args are passed to the callback that can contain these strings.

comment:9 nacin3 months ago

  • Keywords wpautop added

comment:10 mordauk2 months ago

  • Severity changed from trivial to normal

I may get over ruled here, but I'm changing the priority of this from trivial to normal. As an avid plugin developer that spends 80% of every day working in support forums for plugins, this is a huge issue to me. It has cost me so many hours of support time due to themes modifying wpauto() and causing the contents of my plugin's short codes to break.

Note: See TracTickets for help on using tickets.