jp_sitemap_index_type_of
The index type corresponding to a sitemap type.
Description
(string) jp_sitemap_index_type_of( (string) $type );
Returns (string)
The index type.
Parameters (1)
- 0. $type (string)
- The sitemap type.
Usage
if ( !function_exists( 'jp_sitemap_index_type_of' ) ) { require_once '/modules/sitemaps/sitemap-constants.php'; } // The sitemap type. $type = ''; // NOTICE! Understand what this does before running. $result = jp_sitemap_index_type_of($type);
Defined (1)
The function is defined in the following location(s).
- /modules/sitemaps/sitemap-constants.php
- function jp_sitemap_index_type_of( $type ) {
- if ( JP_PAGE_SITEMAP_TYPE === $type ) {
- return JP_PAGE_SITEMAP_INDEX_TYPE;
- } elseif ( JP_IMAGE_SITEMAP_TYPE === $type ) {
- return JP_IMAGE_SITEMAP_INDEX_TYPE;
- } elseif ( JP_VIDEO_SITEMAP_TYPE === $type ) {
- return JP_VIDEO_SITEMAP_INDEX_TYPE;
- } else {
- return "error-bad-type-$type";
- }
- }