[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/sitemaps/ -> class-wp-sitemaps.php (summary)

Sitemaps: WP_Sitemaps class This is the main class integrating all other classes.

File Size: 302 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Sitemaps:: (9 methods):
  __construct()
  init()
  sitemaps_enabled()
  register_sitemaps()
  register_rewrites()
  render_sitemaps()
  send_404()
  redirect_sitemapxml()
  add_robots()


Class: WP_Sitemaps  - X-Ref

Class WP_Sitemaps.

__construct()   X-Ref
WP_Sitemaps constructor.


init()   X-Ref
Initiates all sitemap functionality.

If sitemaps are disabled, only the rewrite rules will be registered
by this method, in order to properly send 404s.


sitemaps_enabled()   X-Ref
Determines whether sitemaps are enabled or not.

return: bool Whether sitemaps are enabled.

register_sitemaps()   X-Ref
Registers and sets up the functionality for all supported sitemaps.


register_rewrites()   X-Ref
Registers sitemap rewrite tags and routing rules.


render_sitemaps()   X-Ref
Renders sitemap templates based on rewrite rules.


send_404()   X-Ref
Sends a 404 for a sitemap route that cannot be served.

WP::handle_404() exempts sitemap requests, so every sitemap 404 is issued
here instead. That includes the no-cache headers handle_404() sends with
its own 404, so an intermediary does not retain a 404 for a route that
becomes valid once the site has more content.


redirect_sitemapxml( $bypass, $query )   X-Ref
Redirects a URL to the wp-sitemap.xml

param: bool     $bypass Pass-through of the pre_handle_404 filter value.
param: WP_Query $query  The WP_Query object.
return: bool Bypass value.

add_robots( $output, $is_public )   X-Ref
Adds the sitemap index to robots.txt.

param: string $output    robots.txt output.
param: bool   $is_public Whether the site is public.
return: string The robots.txt output.



Generated : Tue Sep 29 08:20:35 2026 Cross-referenced by PHPXref