function node_make_sticky_action

Sets the sticky-at-top-of-list property of a node to 1.

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

1 string reference to 'node_make_sticky_action'
BulkFormTest::testBulkForm in drupal/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php
Tests the bulk form.

File

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

Code

function node_make_sticky_action(Node $node, $context = array()) {
  $node->sticky = NODE_STICKY;
  watchdog('action', 'Set @type %title to sticky.', array(
    '@type' => node_get_type_label($node),
    '%title' => $node
      ->label(),
  ));
}