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.
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 theWP_Rewrite
classes uses to generate the value assigned to this property when instantiated.