You are here

function xmlsitemap_get_link_type_enabled_bundles in XML sitemap 2.x

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

Returns enabled bundles of an entity type.

Parameters

string $entity_type: Entity type id.

Return value

array Array with entity bundles info.

3 calls to xmlsitemap_get_link_type_enabled_bundles()
XmlSitemapGenerator::rebuildBatchFetch in src/XmlSitemapGenerator.php
Batch callback; fetch and add the sitemap links for a specific entity.
xmlsitemap_get_rebuildable_link_types in ./xmlsitemap.module
Get all rebuildable entity types.
xmlsitemap_xmlsitemap_index_links in ./xmlsitemap.module
Implements hook_xmlsitemap_index_links().

File

./xmlsitemap.module, line 807
xmlsitemap XML sitemap

Code

function xmlsitemap_get_link_type_enabled_bundles($entity_type) {
  $bundles = [];
  $info = xmlsitemap_get_link_info($entity_type);
  foreach ($info['bundles'] as $bundle => $bundle_info) {
    $settings = xmlsitemap_link_bundle_load($entity_type, $bundle);
    if (!empty($settings['status'])) {
      $bundles[] = $bundle;
    }
  }
  return $bundles;
}