From 2f2363073d25d0b7b3f105f13cf8360c3262806f Mon Sep 17 00:00:00 2001 From: Jim Valentine Date: Thu, 20 Oct 2022 11:18:59 +0100 Subject: [PATCH] Feat: Filter for adding global excludes For WP multisite's that include a large number of sites it is tedious adding new excludes to each and every site. This allows new excludes to be added to every site with a few lines of code: function cdn_linker_excludes($excludes) { $excludes[] = '.some-extension'; return $excludes; } add_filter('cdn-linker-global-excludes', 'cdn_linker_excludes'); --- cdn-linker-base.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cdn-linker-base.php b/cdn-linker-base.php index 03d635d..fc9d7e3 100644 --- a/cdn-linker-base.php +++ b/cdn-linker-base.php @@ -225,6 +225,7 @@ function register_as_output_buffer_handler() { } $excludes = array_map('trim', explode(',', get_option('ossdl_off_exclude'))); + $excludes = apply_filters('cdn-linker-global-excludes', $excludes); $rewriter = new URI_changer( get_option('siteurl'), target_url_strategy_for(trim(get_option('ossdl_off_cdn_url'))),