You are here

function rb_misc_action_set_node_creation_time in Rules Bonus Pack 6

The 'rb_misc_action_set_node_creation_time' action.

File

./rb_misc.module, line 491
Miscellaneous conditions and actions for Rules.

Code

function rb_misc_action_set_node_creation_time($node, $settings) {

  // Load the configured time as a timestamp, or default to current time.
  $time = empty($settings['time']) ? time() : strtotime($settings['time']);

  // Set the post time and return the node for saving.
  $node->created = $time;
  return array(
    'node' => $node,
  );
}