1 node.module node_make_sticky_action(Node $node, &$context)

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

Parameters

Node $node: A node entity.

$context: Contextual information about the triggered action.

Related topics

File

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

Code

function node_make_sticky_action(Node $node, &$context) {
  $node->sticky = NODE_STICKY;
  $node->save();
}