Uses
Uses | Description |
---|---|
wp-includes/pluggable.php: wp_safe_redirect() | Performs a safe (local) redirect, using wp_redirect(). |
Redirects a URL to the wp-sitemap.xml
(bool) Bypass value.
File: wp-includes/sitemaps/class-wp-sitemaps.php
public function redirect_sitemapxml( $bypass, $query ) { // If a plugin has already utilized the pre_handle_404 function, return without action to avoid conflicts. if ( $bypass ) { return $bypass; } // 'pagename' is for most permalink types, name is for when the %postname% is used as a top-level field. if ( 'sitemap-xml' === $query->get( 'pagename' ) || 'sitemap-xml' === $query->get( 'name' ) ) { wp_safe_redirect( $this->index->get_index_url() ); exit(); } return $bypass; }
Version | Description |
---|---|
5.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_sitemaps/redirect_sitemapxml