keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

fix permalink structure handling #263

Closed coreykn closed 3 years ago

coreykn commented 3 years ago

Fix permalink structure handling for multisites from a change made in PR #251. When using switch_to_blog() beforehand this can result in the wrong $GLOBALS['wp_rewrite']->use_trailing_slashes being returned (as explained in that PR). That would result in the originating site permalink structure being used in some cases instead of from the switched-to site. I do not think it is worth reinitializing this class to get the correct value for only this property (like we do in the cache iterator). Instead, use what the WP_Rewrite classes uses to generate the value assigned to this property when instantiated.