gglstmp_sitemap_info

The Google Sitemap by BestWebSoft gglstmp sitemap info function.

Description

gglstmp_sitemap_info(); 

Usage

  1. if ( !function_exists( 'gglstmp_sitemap_info' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-sitemap-by-bestwebsoft/google-sitemap-plugin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gglstmp_sitemap_info(); 
  7.  

Defined (1)

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

/google-sitemap-plugin.php  
  1. function gglstmp_sitemap_info() { 
  2. global $gglstmp_settings; 
  3.  
  4. if ( is_multisite() ) { 
  5. $home_url = preg_replace( "/[^a-zA-Z*-**-*0-9\s]/", "_", str_replace( 'http://', '', str_replace( 'https://', '', site_url() ) ) ); 
  6. $xml_file = 'sitemap_' . $home_url . '.xml'; 
  7. } else { 
  8. $xml_file = 'sitemap.xml'; 
  9.  
  10. $xml_path = ABSPATH . $xml_file; 
  11. $xml_url = site_url( '/' ) . $xml_file; 
  12. if ( file_exists( $xml_path ) ) { 
  13. $gglstmp_settings['sitemap'] = array( 
  14. 'file' => $xml_file,  
  15. 'path' => $xml_path,  
  16. 'loc' => $xml_url,  
  17. 'lastmod' => date( 'Y-m-d\TH:i:sP', filemtime( $xml_path ) ) 
  18. ); 
  19. update_option( 'gglstmp_settings', $gglstmp_settings );