You are here

function xmlsitemap_link_presave in XML sitemap 7.2

Presave a sitemap link.

Parameters

array $link: An array with a sitemap link.

array $context: An optional context array containing data related to the link.

Related topics

1 call to xmlsitemap_link_presave()
xmlsitemap_node_node_update in xmlsitemap_node/xmlsitemap_node.module
Implements hook_node_update().

File

./xmlsitemap.module, line 620
xmlsitemap XML sitemap

Code

function xmlsitemap_link_presave(array $link, array $context = array()) {

  // Force link access to 0 in presave so that the link is saved with revoked
  // access until the node permissions are checked in the cron.
  $link['access'] = 0;

  // Allow other modules to alter the sitemap link presave.
  drupal_alter('xmlsitemap_link_presave', $link, $context);

  // Save or update a sitemap link which will be overwritten in Drupal cron job.
  xmlsitemap_link_save($link, $context);
}