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;
} /**
* Adds the sitemap index to robots.txt.
*
* @since 5.5.0
*
* @param string $output robots.txt output.
* @param bool $is_public Whether the site is public.
* @return string The robots.txt output.
*/