class DemoteNode

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

Demotes a node.

Plugin annotation


@Action(
  id = "node_unpromote_action",
  label = @Translation("Demote selected content from front page"),
  type = "node"
)

Hierarchy

Expanded class hierarchy of DemoteNode

File

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

Namespace

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

}

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