You are here

function xmlsitemap_priority_options in XML sitemap 5.2

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

Get an array of sitemap 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 sitemap.
  • 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.

5 calls to xmlsitemap_priority_options()
xmlsitemap_node_form_alter in xmlsitemap_node/xmlsitemap_node.module
Implementation of hook_form_alter().
xmlsitemap_settings_sitemap in xmlsitemap/xmlsitemap.module
Menu callback; return sitemap 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().
xmlsitemap_user_user in xmlsitemap_user/xmlsitemap_user.module
Implementation of hook_user().

File

xmlsitemap/xmlsitemap.module, line 405
Creates a sitemap compatible with the sitemaps.org schema.

Code

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