diff --git a/camo-image-proxy.php b/camo-image-proxy.php index 8ea8e5b240cba5c07dbdf847dc7bff4ef1c5b5dd..2403a197c406dc67441192c366f677b95e2aca66 100755 --- a/camo-image-proxy.php +++ b/camo-image-proxy.php @@ -58,10 +58,11 @@ function init() { Options::instance(); URL::instance(); - // Don't rewrite in the admin! if ( is_admin() ) { Options_Page::instance(); - } else { + } + + if ( URL::instance()->can_rewrite() ) { Rewrite_URLs::instance(); Rewrite_Content::instance(); } diff --git a/inc/class-url.php b/inc/class-url.php index dc2475e5137220650b3eb88e39b537cc96807c17..33b4496143841e0b94eb78ba4d2b63035651c2bf 100644 --- a/inc/class-url.php +++ b/inc/class-url.php @@ -19,6 +19,11 @@ class URL { * @return bool */ public function can_rewrite() : bool { + // Never rewrite in admin. + if ( is_admin() ) { + return false; + } + $host = Options::instance()->get( 'host' ); $key = Options::instance()->get( 'key' );