Skip to content

Instantly share code, notes, and snippets.

@jimi008
Last active March 4, 2020 09:22
Show Gist options
  • Save jimi008/f5a75f83d7ba9afa0afc85970ad0dd86 to your computer and use it in GitHub Desktop.
Save jimi008/f5a75f83d7ba9afa0afc85970ad0dd86 to your computer and use it in GitHub Desktop.
Redirection plugin: ignore the files in the wp-content/cache dir because they are always temporary.
<?php
/**
* Redirection plugin: ignore the files in the wp-content/cache dir because they are always temporary.
*/
function child_theme_ignore_cachefiles($insert) {
if (isset($insert['url']) && false !== strpos($insert['url'], '/wp-content/cache/')) {
$insert = false;
}
return $insert;
}
add_filter('redirection_404_data', 'child_theme_ignore_cachefiles');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment