gglstmp_robots_add_sitemap

The Google Sitemap by BestWebSoft gglstmp robots add sitemap function.

Description

gglstmp_robots_add_sitemap( $output, $public ); 

Parameters (2)

0. $output
The output.
1. $public
The public.

Usage

  1. if ( !function_exists( 'gglstmp_robots_add_sitemap' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-sitemap-by-bestwebsoft/google-sitemap-plugin.php'; 
  3.  
  4. // The output. 
  5. $output = null; 
  6.  
  7. // The public. 
  8. $public = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = gglstmp_robots_add_sitemap($output, $public); 
  12.  

Defined (1)

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

/google-sitemap-plugin.php  
  1. function gglstmp_robots_add_sitemap( $output, $public ) { 
  2. if ( '0' == $public ) { 
  3. return $output; 
  4. } else { 
  5. if ( false === strpos( $output, 'Sitemap' ) ) { 
  6. if ( is_multisite() ) { 
  7. $home_url = preg_replace( "/[^a-zA-Z*-**-*0-9\s]/", "_", str_replace( 'http://', '', str_replace( 'https://', '', site_url() ) ) ); 
  8. $output .= "Sitemap: " . site_url( "/" ) . "sitemap_" . $home_url . ".xml"; 
  9. } else { 
  10. $output .= "Sitemap: " . site_url( "/" ) . "sitemap.xml"; 
  11. return $output;