WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 5 months ago

#30531 assigned enhancement

Make wptexturize the last filter before output

Reported by: azaozz Owned by: azaozz
Milestone: Priority: normal
Severity: normal Version:
Component: Formatting Keywords:
Focuses: Cc:
PR Number:

Description

This will allow it to be simplified/refactored and run faster.

Advantages:

  • Not looking at shortcodes as it will run after do_shortcode(). That will make it less complex and faster. This also avoids all edge cases with shortcodes.
  • Better detection/handling of quotes around <p> tags as it will run after wpautop(). Also, preg_split() will split the text in more chunks which will be easier to process.

Disadvantage: the no_texturize_shortcodes filter will stop working.

Change History (6)

#1 @azaozz
5 years ago

We've discussed this with @miqrogroove some time ago and it seems the best way forward.

A simple workaround for the no_texturize_shortcodes filter would be to insert markers around these shortcodes, and remove them after wptexturize() (as discussed in https://core.trac.wordpress.org/ticket/29608#comment:13).

Alternatively that filter can be deprecated, depending on how many plugins are using it. Certain HTML tags are excluded from texturizing, and more can be added by plugins. For example the [code] shortcode would be replaced by <pre> or <code> tag, both of which are excluded.

#2 @obenland
5 years ago

  • Owner set to azaozz
  • Status changed from new to assigned

#3 @obenland
5 years ago

  • Keywords 4.2-early removed
  • Milestone changed from Future Release to 4.3

#4 @obenland
4 years ago

  • Milestone changed from 4.3 to Future Release

#5 @miqrogroove
4 years ago

#29810 was marked as a duplicate.

#6 @miqrogroove
4 years ago

This goes hand-in-hand with #6984 and I've tried to close all other related tickets as duplicates.

Note: See TracTickets for help on using tickets.