You are here

protected function UrlGeneratorBase::replaceBaseUrlWithCustom in Simple XML sitemap 4.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\UrlGeneratorBase::replaceBaseUrlWithCustom()
  2. 8.2 src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\UrlGeneratorBase::replaceBaseUrlWithCustom()

Parameters

string $url:

Return value

string

4 calls to UrlGeneratorBase::replaceBaseUrlWithCustom()
EntityUrlGeneratorBase::getAlternateUrlsForAllLanguages in src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php
EntityUrlGeneratorBase::getAlternateUrlsForDefaultLanguage in src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php
EntityUrlGeneratorBase::getAlternateUrlsForTranslatedLanguages in src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php
EntityUrlGeneratorBase::getEntityImageData in src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php

File

src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php, line 79

Class

UrlGeneratorBase
Class UrlGeneratorBase

Namespace

Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator

Code

protected function replaceBaseUrlWithCustom(string $url) : string {
  return !empty($base_url = $this->settings
    ->get('base_url')) ? str_replace($GLOBALS['base_url'], $base_url, $url) : $url;
}