AVRIL_START_JANCOKALIVEAVRIL_END_JANCOK
| Server IP : dzynews.com / Your IP : 216.73.217.105 Web Server : nginx/1.30.3 System : Linux cloud-tdkldl-avd6 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 User : www ( 1000) PHP Version : 8.2.31 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/dzynews.com/wp-content/plugins/classic-maintenance/inc/ |
Upload File : |
<?php
/**
* Sitemaps: WP_Sitemaps_Registry class
*
* Handles registering sitemaps.
*
* @package WordPress
* @subpackage Sitemaps
* @since 5.5.0
*/
/**
* Class WP_Sitemaps_Registry.
*
* @since 5.5.0
*/
class WP_Sitemaps_Registry {
/**
* Registered sitemaps.
*
* @since 5.5.0
*
* @var array Array of registered sitemaps.
*/
private $sitemaps = array();
/**
* Adds a sitemap with route to the registry.
*
* @since 5.5.0
*
* @param string $name Name of the sitemap.
* @param WP_Sitemaps_Provider $provider Instance of a WP_Sitemaps_Provider.
* @return bool True if the sitemap was added, false if it is already registered.
*/
public function add_sitemap( $name, WP_Sitemaps_Provider $provider ) {
if ( isset( $this->sitemaps[ $name ] ) ) {
return false;
}
$this->sitemaps[ $name ] = $provider;
return true;
}
/**
* Returns a single registered sitemaps provider.
*
* @since 5.5.0
*
* @param string $name Sitemap provider name.
* @return WP_Sitemaps_Provider|null Sitemaps provider if it exists, null otherwise.
*/
public function get_sitemap( $name ) {
if ( ! isset( $this->sitemaps[ $name ] ) ) {
return null;
}
return $this->sitemaps[ $name ];
}
/**
* Lists all registered sitemaps.
*
* @since 5.5.0
*
* @return array List of sitemaps.
*/
public function get_sitemaps() {
$total_sitemaps = count( $this->sitemaps );
if ( $total_sitemaps > WP_SITEMAPS_MAX_SITEMAPS ) {
return array_slice( $this->sitemaps, 0, WP_SITEMAPS_MAX_SITEMAPS, true );
}
return $this->sitemaps;
}
}