function node_unpromote_action

Sets the promote property of a node to 0.

Parameters

Drupal\node\Node $node: A node entity.

$context: (optional) Array of additional information about what triggered the action. Not used for this action.

Related topics

File

drupal/core/modules/node/node.module, line 3545
The core module that allows content to be submitted to the site.

Code

function node_unpromote_action(Node $node, $context = array()) {
  $node->promote = NODE_NOT_PROMOTED;
  watchdog('action', 'Removed @type %title from front page.', array(
    '@type' => node_get_type_label($node),
    '%title' => $node
      ->label(),
  ));
}