Multisite problems
-
Hi,
Im running a multisite setup with domainmaped subsites.
The problem is that the plugin is using homeurl as the URL to make purge requests.
I my case the homeurl is “mastersite.com” and i have “subsite1.com” and “subsite2.com”. In wp admin the urls is “mastersite.com/subsite1” and “mastersite.com/subsite2”.
It works when i update posts because i added the following filter:
add_filter('vhp_purge_urls', function ($urls, $postId) { $mappedDomain = domain_mapping_siteurl([]); $adminUrl = home_url(); foreach ($urls as &$url) { $url = str_replace($adminUrl, $mappedDomain, $url); } return $urls; }, 10, 2);When I using the global button in the admin bar i endup in the function purgeUrl (Row 248).
When that method is called on row 231 in executePurge its looks like this:
$this->purgeUrl( home_url() .'/?vhp-regex' );My problem is that the home_url is mastersite.com/subsite1 and not subsite1.com.
Im using this plugin for domain mapping: https://sv.ww.wp.xz.cn/plugins/wordpress-mu-domain-mapping/
Would it be possible for you to fixe the plugin so it works when i use multisite with domainmapping?
You can use the function
domain_mapping_siteurl([])to get the domainmapped site_url.Many thanks
//Tim Cifuentes Vargas
The topic ‘Multisite problems’ is closed to new replies.