You are here

function xmlsitemap_get_rebuildable_link_types in XML sitemap 8

Same name and namespace in other branches
  1. 6.2 xmlsitemap.generate.inc \xmlsitemap_get_rebuildable_link_types()
  2. 7.2 xmlsitemap.generate.inc \xmlsitemap_get_rebuildable_link_types()
  3. 2.x xmlsitemap.module \xmlsitemap_get_rebuildable_link_types()

Get all rebuildable entity types.

Return value

array Array with all rebuildable entity types.

4 calls to xmlsitemap_get_rebuildable_link_types()
drush_xmlsitemap_rebuild in ./xmlsitemap.drush.inc
Dump and rebuild all the sitemap data, then regenerate the files.
XmlSitemapCommands::rebuild in src/Commands/XmlSitemapCommands.php
Dump and re-process all possible XML sitemap data, then regenerate files.
XmlSitemapRebuildForm::buildForm in src/Form/XmlSitemapRebuildForm.php
Form constructor.
_xmlsitemap_rebuild_form_access in ./xmlsitemap.module
Menu access callback; determines if the user can use the rebuild links page.

File

./xmlsitemap.module, line 2613
xmlsitemap XML sitemap

Code

function xmlsitemap_get_rebuildable_link_types() {
  $rebuild_types = [];
  $entities = xmlsitemap_get_link_info();
  foreach ($entities as $entity => $info) {
    if (empty($info['xmlsitemap']['rebuild callback'])) {

      // If the entity is missing a rebuild callback, skip.
      continue;
    }
    if (!empty($info['bundles']) && !xmlsitemap_get_link_type_enabled_bundles($entity)) {

      // If the entity has bundles, but no enabled bundles, skip since
      // rebuilding wouldn't get any links.
      continue;
    }
    $rebuild_types[] = $entity;
  }
  return $rebuild_types;
}