You are here

function xmlsitemap_get_status_options in XML sitemap 2.x

Same name and namespace in other branches
  1. 8 xmlsitemap.module \xmlsitemap_get_status_options()
  2. 6.2 xmlsitemap.admin.inc \xmlsitemap_get_status_options()
  3. 7.2 xmlsitemap.admin.inc \xmlsitemap_get_status_options()

Get a list of priority options.

Parameters

string $default: Include a 'default' option.

Return value

array An array of options.

See also

_xmlsitemap_translation_strings()

3 calls to xmlsitemap_get_status_options()
xmlsitemap_add_form_entity_summary in ./xmlsitemap.module
Add a table summary for an entity and its bundles.
xmlsitemap_add_form_link_options in ./xmlsitemap.module
Add a link's XML sitemap options to the link's form.
xmlsitemap_add_link_bundle_settings in ./xmlsitemap.module
Add the link type XML sitemap options to the link type's form.

File

./xmlsitemap.module, line 2199
xmlsitemap XML sitemap

Code

function xmlsitemap_get_status_options($default = NULL) {
  $options = [];
  $statuses = [
    1 => t('Included'),
    0 => t('Excluded'),
  ];
  if (isset($default)) {
    $default = $default ? 1 : 0;
    $options['default'] = t('Default (@value)', [
      '@value' => mb_strtolower($statuses[$default]),
    ]);
  }
  $options += $statuses;
  return $options;
}