You are here

function xmlsitemap_priority_options in XML sitemap 5

Same name and namespace in other branches
  1. 5.2 xmlsitemap/xmlsitemap.module \xmlsitemap_priority_options()
  2. 6 xmlsitemap.module \xmlsitemap_priority_options()

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

6 calls to xmlsitemap_priority_options()
xmlsitemap_node_form_alter in xmlsitemap_node/xmlsitemap_node.module
Implementation of hook_form_alter().
xmlsitemap_settings_additional in ./xmlsitemap.module
Menu callback; return additional links form.
xmlsitemap_settings_sitemap in ./xmlsitemap.module
Menu callback; return site map settings form.
xmlsitemap_term_form_alter in xmlsitemap_term/xmlsitemap_term.module
Implementation of hook_form_alter().
xmlsitemap_user_form_alter in xmlsitemap_user/xmlsitemap_user.module
Implementation of hook_form_alter().

... See full list

File

./xmlsitemap.module, line 304
Creates a site map compatible with the sitemaps.org schema.

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;
}