You are here

class PromoteNode in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/node/src/Plugin/Action/PromoteNode.php \Drupal\node\Plugin\Action\PromoteNode
  2. 9 core/modules/node/src/Plugin/Action/PromoteNode.php \Drupal\node\Plugin\Action\PromoteNode

Promotes a node.

Plugin annotation


@Action(
  id = "node_promote_action",
  label = @Translation("Promote selected content to front page"),
  type = "node"
)

Hierarchy

Expanded class hierarchy of PromoteNode

File

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

Namespace

Drupal\node\Plugin\Action
View source
class PromoteNode extends FieldUpdateActionBase {

  /**
   * {@inheritdoc}
   */
  protected function getFieldsToUpdate() {
    return [
      'promote' => NodeInterface::PROMOTED,
    ];
  }

}

Members