wpseek.com
A WordPress-centric search engine for devs and theme authors
get_sitemap_url › WordPress Function
Since5.5.1
Deprecatedn/a
› get_sitemap_url ( $name, $subtype_name = '', $page = 1 )
Parameters: (3) |
|
Returns: |
|
Defined at: |
|
Codex: |
Retrieves the full URL for a sitemap.
Related Functions: get_site_url, get_site_icon_url, get_temp_dir, get_post_embed_url, network_site_url
Source
function get_sitemap_url( $name, $subtype_name = '', $page = 1 ) { $sitemaps = wp_sitemaps_get_server(); if ( ! $sitemaps ) { return false; } if ( 'index' === $name ) { return $sitemaps->index->get_index_url(); } $provider = $sitemaps->registry->get_provider( $name ); if ( ! $provider ) { return false; } if ( $subtype_name && ! in_array( $subtype_name, array_keys( $provider->get_object_subtypes() ), true ) ) { return false; } $page = absint( $page ); if ( 0 >= $page ) { $page = 1; } return $provider->get_sitemap_url( $subtype_name, $page ); }