apply_filters( 'DevOwl/RealProductManager/HostMap/ConnectThematic', $host, $blogId ) → {string}
This filter allows you to connect multiple hosts / subdomains to one main host and reduce the number of needed license keys.
This filter is only allowed to link thematically, related subdomains / domains, so that one license key is valid for these subdomains / domains.
Use case example: Multilingual through multisite
You have a multisite and each subsite represents a language. When opening the license activation in dialog and you need to activate a license for each language:
- English (example.com)
- German (de.example.com)
- Spanish (es.example.com)
You can add the following filter to your functions.php
to map de.
and es.
to the main host example.com
<?php
add_filter('DevOwl/RealProductManager/HostMap/ConnectThematic', function($host) {
return "example.com";
});
Afterward, only one license is requested for example.com
.
Use case example: Shop and blog
You have a multisite and there you maintain pages for different organizations. Each organization has a blog and a store. When opening the license activation in dialog and you need to activate a license for each language:
- Main (example.com)
- Organization 1 (org1.com)
- Organization 1 shop (shop.org1.com)
- Organization 2 (org2.com)
- Organization 2 shop (shop.org2.com)
Now, instead of needed two license keys for each organization you can connect it thematically:
<?php
add_filter('DevOwl/RealProductManager/HostMap/ConnectThematic', function($host) {
if ($host === 'shop.org1.com') {
return 'org1.com';
}
if ($host === 'shop.org2.com') {
return 'org2.com';
}
return $host;
});
Afterward, only three licenses are requested for example.com
, org1.com
and org2.com
.
Parameters:
Name | Type | Description |
---|---|---|
$host |
string | |
$blogId |
int |
- Since:
- 1.7.9
- See:
Returns:
- Type
- string