| Server IP : 185.11.201.71 / Your IP : 192.168.7.18 Web Server : Apache/2.4.29 (Ubuntu) System : Linux tech-virtual-machine 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 User : tech ( 1000) PHP Version : 7.4.28 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/enaireretos/wp-content/plugins/polylang/modules/sitemaps/ |
Upload File : |
<?php
/**
* @package Polylang
*/
/**
* Handles the core sitemaps for subdomains and multiple domains.
*
* @since 3.0
*/
class PLL_Sitemaps_Domain extends PLL_Abstract_Sitemaps {
/**
* @var PLL_Links_Abstract_Domain
*/
protected $links_model;
/**
* Constructor.
*
* @since 3.0
*
* @param object $polylang Main Polylang object.
*/
public function __construct( &$polylang ) {
$this->links_model = &$polylang->links_model;
}
/**
* Setups actions and filters.
*
* @since 3.0
*
* @return void
*/
public function init() {
parent::init();
add_filter( 'wp_sitemaps_index_entry', array( $this, 'index_entry' ) );
add_filter( 'wp_sitemaps_stylesheet_url', array( $this->links_model, 'site_url' ) );
add_filter( 'wp_sitemaps_stylesheet_index_url', array( $this->links_model, 'site_url' ) );
add_filter( 'home_url', array( $this, 'sitemap_url' ) );
}
/**
* Filters the sitemap index entries for subdomains and multiple domains.
*
* @since 2.8
*
* @param array $sitemap_entry Sitemap entry for the post.
* @return array
*/
public function index_entry( $sitemap_entry ) {
$sitemap_entry['loc'] = $this->links_model->site_url( $sitemap_entry['loc'] );
return $sitemap_entry;
}
/**
* Makes sure that the sitemap urls are always evaluated on the current domain.
*
* @since 2.8.4
*
* @param string $url A sitemap url.
* @return string
*/
public function sitemap_url( $url ) {
if ( false !== strpos( $url, '/wp-sitemap' ) ) {
$url = $this->links_model->site_url( $url );
}
return $url;
}
}