function xmlsitemap_get_rebuildable_link_types in XML sitemap 2.x
Same name and namespace in other branches
- 8 xmlsitemap.module \xmlsitemap_get_rebuildable_link_types()
- 6.2 xmlsitemap.generate.inc \xmlsitemap_get_rebuildable_link_types()
- 7.2 xmlsitemap.generate.inc \xmlsitemap_get_rebuildable_link_types()
Get all rebuildable entity types.
Return value
array Array with all rebuildable entity types.
3 calls to xmlsitemap_get_rebuildable_link_types()
- 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 2544 - 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;
}