class StickyNode

Same name and namespace in other branches
  1. 11.x core/modules/node/src/Plugin/Action/StickyNode.php \Drupal\node\Plugin\Action\StickyNode
  2. 10 core/modules/node/src/Plugin/Action/StickyNode.php \Drupal\node\Plugin\Action\StickyNode
  3. 8.9.x core/modules/node/src/Plugin/Action/StickyNode.php \Drupal\node\Plugin\Action\StickyNode

Makes a node sticky.

Plugin annotation


@Action(
  id = "node_make_sticky_action",
  label = @Translation("Make selected content sticky"),
  type = "node"
)

Hierarchy

Expanded class hierarchy of StickyNode

File

core/modules/node/src/Plugin/Action/StickyNode.php, line 17

Namespace

Drupal\node\Plugin\Action
View source
class StickyNode extends FieldUpdateActionBase {
  
  /**
   * {@inheritdoc}
   */
  protected function getFieldsToUpdate() {
    return [
      'sticky' => NodeInterface::STICKY,
    ];
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.