jp_sitemap_child_type_of

The sitemap type corresponding to an index type.

Description

(string) jp_sitemap_child_type_of( (string) $type ); 

Returns (string)

The sitemap type.

Parameters (1)

0. $type (string)
The index type.

Usage

  1. if ( !function_exists( 'jp_sitemap_child_type_of' ) ) { 
  2. require_once '/modules/sitemaps/sitemap-constants.php'; 
  3.  
  4. // The index type. 
  5. $type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = jp_sitemap_child_type_of($type); 
  9.  

Defined (1)

The function is defined in the following location(s).

/modules/sitemaps/sitemap-constants.php  
  1. function jp_sitemap_child_type_of( $type ) { 
  2. if ( JP_PAGE_SITEMAP_INDEX_TYPE === $type ) { 
  3. return JP_PAGE_SITEMAP_TYPE; 
  4. } elseif ( JP_IMAGE_SITEMAP_INDEX_TYPE === $type ) { 
  5. return JP_IMAGE_SITEMAP_TYPE; 
  6. } elseif ( JP_VIDEO_SITEMAP_INDEX_TYPE === $type ) { 
  7. return JP_VIDEO_SITEMAP_TYPE; 
  8. } else { 
  9. return "error-bad-type-$type";