WP_Sitemaps::register_sitemaps() WordPress Method
The WP_Sitemaps::register_sitemaps() method is used to register sitemaps with the WordPress sitemaps API. This method should be called from the 'init' action hook. The first parameter is an array of sitemap types. The array keys are the sitemap type names, and the array values are the class names of the sitemap classes. The second parameter is an array of sitemap arguments. The array keys are the sitemap type names, and the array values are the arrays of sitemap arguments. The third parameter is an array of callback functions. The array keys are the sitemap type names, and the array values are the name of the callback functions. The fourth parameter is an array of class instances. The array keys are the sitemap type names, and the array values are the class instances.
WP_Sitemaps::register_sitemaps() #
Registers and sets up the functionality for all supported sitemaps.
Source
File: wp-includes/sitemaps/class-wp-sitemaps.php
public function register_sitemaps() {
$providers = array(
'posts' => new WP_Sitemaps_Posts(),
'taxonomies' => new WP_Sitemaps_Taxonomies(),
'users' => new WP_Sitemaps_Users(),
);
/* @var WP_Sitemaps_Provider $provider */
foreach ( $providers as $name => $provider ) {
$this->registry->add_provider( $name, $provider );
}
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |