Make WordPress Core

Opened 2 years ago

#54721 new defect (bug)

wptexturize caches the result of run_wptexturize preventing themes from using this if a plugin has already called get_plugin_data

Reported by: tremlas's profile tremlas Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.8.2
Component: Formatting Keywords:
Focuses: Cc:


One of the plugins I use is simple_sitemap. This plugin (quite reasonably) uses get_plugin_data during its initialization. get_plugin_data makes calls to wptexturize as part of its operation. The plugin's initialization runs before the theme's functions.php is executed. Since wptexturize caches the result of the run_wptexturize filter, the theme is no longer able to disable wptexturize's function and hence gets unwanted smart quotes.

There is a workaround for the theme whereby it makes a dummy call to wptexturize with reset set to true. This makes the wptexturize implementation reinitialize and hence re-execute the call to the run_wptexturize filter. However the documentation states that this flag is designed for unit testing and hence this seems to be less than ideal.

(In passing I'll note that this caching of the result also prevents plugins from using it to temporarily disable the function by adding and then removing the filter should it be required.)

I've left the ticket type as 'defect' but it would be reasonable to argue that this is actually a request for a minor enhancement - if so please change the type field.

Change History (0)

Note: See TracTickets for help on using tickets.