From e60e1b0de8bf93e6e8b9b3cf831ef6ac4da46aa2 Mon Sep 17 00:00:00 2001 From: Twansparant Date: Wed, 26 Jun 2019 14:03:32 +0200 Subject: [PATCH] Add ajax support for relative urls module --- modules/relative-urls.php | 2 +- soil.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/relative-urls.php b/modules/relative-urls.php index 755ab2d5..bfaf15bf 100644 --- a/modules/relative-urls.php +++ b/modules/relative-urls.php @@ -14,7 +14,7 @@ * add_theme_support('soil-relative-urls'); */ -if (is_admin() || isset($_GET['sitemap']) || in_array($GLOBALS['pagenow'], ['wp-login.php', 'wp-register.php'])) { +if ((is_admin() && !wp_doing_ajax()) || isset($_GET['sitemap']) || in_array($GLOBALS['pagenow'], ['wp-login.php', 'wp-register.php'])) { return; } diff --git a/soil.php b/soil.php index 39992ac1..ef3ca016 100644 --- a/soil.php +++ b/soil.php @@ -55,8 +55,8 @@ public function set($options) { function load_modules() { global $_wp_theme_features; - // Skip loading modules in the admin. - if (is_admin()) { + // Skip loading modules in the admin but allow in ajax actions. + if ((is_admin() && !wp_doing_ajax())) { return; }