You are here

function scheduler_remove_unpublish_date_action in Scheduler 7

Remove the unpublish_on date for the node.

Parameters

object $node: The node object from which to remove the unpublish_on date.

1 string reference to 'scheduler_remove_unpublish_date_action'
scheduler_default_rules_configuration in ./scheduler.rules_defaults.inc
Implements hook_default_rules_configuration().

File

./scheduler.rules.inc, line 186
Scheduler rules functions.

Code

function scheduler_remove_unpublish_date_action($node) {
  if (variable_get('scheduler_unpublish_enable_' . $node->type, 0)) {
    $node->unpublish_on = 0;
    scheduler_node_presave($node);
    scheduler_node_update($node);
  }
  else {
    $type_name = node_type_get_name($node->type);
    watchdog('scheduler', 'Scheduled unpublishing is not enabled for %type content. To prevent this message add the condition "Scheduled unpublishing is enabled" to your Rule, or enable the Scheduler options via the %type content type settings.', array(
      '%type' => $type_name,
    ), WATCHDOG_WARNING, l(t('@type settings', array(
      '@type' => $type_name,
    )), 'admin/structure/types/manage/' . $node->type));
  }
}