All posts worked as subdomains. The list of published posts was loaded, expanding the “manual list” in the plugin settings. Attached a link to the modified version:
Old modified version
multidomainmapping_alter.php
$siteurl = get_option("siteurl");//the address of the main page of WordPress site
$url_info = parse_url($siteurl);//get all the components of the url: scheme and host
//get all published posts
$query = new WP_Query;
$posts = $query->query
(
array
(
'post_type'=>'post',
'post_status'=>'publish',
'posts_per_page' => -1
)
);
$falke_mdm_domains_posts = array();//domains that are automatically generated from titles of posts
foreach ($posts as $post)//go through all the posts, and add to the list of their respective subdomains and source URLs
{
$domain = $url_info['scheme'].'://'.$post->post_name.'.'.$url_info['host'];
//save domains in a separate array,
// which are automatically generated from post titles are automatically generated from titles of posts
//this is necessary to exclude them later when saving to the database,
//to not display them in the form of saving domains-URLs
$falke_mdm_domains_posts[] = $domain;
//also add these domains to the General list of domains,
//which contains also the domains are taken from plugin settings
$falke_mdm_domains[] = $domain;
$falke_mdm_destinations[] = '/'.$post->post_name;
}
multidomainmapping.php
require 'multidomainmapping_alter.php'; // 111 line
global $falke_mdm_domains_posts; if (in_array($v,$falke_mdm_domains_posts)) continue; // 433 line
-
This reply was modified 5 years, 6 months ago by
WebFR.