You are here

function xmlsitemap_robotstxt in XML sitemap 7.2

Same name and namespace in other branches
  1. 8 xmlsitemap.module \xmlsitemap_robotstxt()
  2. 5.2 xmlsitemap/xmlsitemap.module \xmlsitemap_robotstxt()
  3. 5 xmlsitemap.module \xmlsitemap_robotstxt()
  4. 6.2 xmlsitemap.module \xmlsitemap_robotstxt()
  5. 6 xmlsitemap.module \xmlsitemap_robotstxt()
  6. 2.x xmlsitemap.module \xmlsitemap_robotstxt()

Implements hook_robotstxt().

1 string reference to 'xmlsitemap_robotstxt'
xmlsitemap_settings_form in ./xmlsitemap.admin.inc
Form builder; Administration settings form.

File

./xmlsitemap.module, line 286
xmlsitemap XML sitemap

Code

function xmlsitemap_robotstxt() {
  if (variable_get('xmlsitemap_robotstxt', 1)) {
    if ($sitemap = xmlsitemap_sitemap_load_by_context()) {
      $robotstxt[] = 'Sitemap: ' . url($sitemap->uri['path'], $sitemap->uri['options']);
      return $robotstxt;
    }
  }
}