[wp-trac] [WordPress Trac] #54721: wptexturize caches the result of run_wptexturize preventing themes from using this if a plugin has already called get_plugin_data

WordPress Trac noreply at wordpress.org
Mon Jan 3 11:45:01 UTC 2022


#54721: wptexturize caches the result of run_wptexturize preventing themes from
using this if a plugin has already called get_plugin_data
--------------------------+-----------------------------
 Reporter:  tremlas       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Formatting    |    Version:  5.8.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54721>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list