xmlsitemap_priority_options

Definition

xmlsitemap_priority_options($option = NULL)
contributions/modules/xmlsitemap/xmlsitemap.module, line 215

Description

Get an array of site map priority options.

Parameters

$option: If not given, the array will include priority values from 0.0 to 1.0.

  • exclude: Add option to exclude item from site map.
  • default: Add option to use default priority. Only for cases where a default priority exists.
  • both: Add both the default and exclude options.

Return value

An array of priority options.

Related topics

Namesort iconDescription
XML SitemapNotify search engines of site updates.

Code

function xmlsitemap_priority_options($option = NULL) {
  if ($option == 'default' || $option == 'both') {
    $options['NULL'] = t('Default');
  }
  $options['1'] = '1.0';
  $values = array('0.9', '0.8', '0.7', '0.6', '0.5', '0.4', '0.3', '0.2', '0.1');
  foreach ($values as $value) {
    $options[$value] = $value;
  }
  $options['0'] = '0.0';
  if ($option == 'exclude' || $option == 'both') {
    $options['-1'] = t('Not in site map');
  }
  return $options;
}