Last active
October 11, 2018 14:59
-
-
Save remyperona/35265298b0daaacf96d2dcf38d61769b to your computer and use it in GitHub Desktop.
Allow caching of WP feed by WP Rocket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wp_rocket_cache_feed( $uri ) { | |
$feed = '/(.+/)?' . $GLOBALS['wp_rewrite']->feed_base . '/?'; | |
if ( in_array( $feed, $uri ) ) { | |
$uri = array_flip( $uri ); | |
unset( $uri[ $feed ] ); | |
$uri = array_flip( $uri ); | |
} | |
return $uri; | |
} | |
add_filter( 'rocket_cache_reject_uri', 'wp_rocket_cache_feed' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment