function UnpublishAction::execute
Same name in other branches
- 9 core/lib/Drupal/Core/Action/Plugin/Action/UnpublishAction.php \Drupal\Core\Action\Plugin\Action\UnpublishAction::execute()
- 10 core/lib/Drupal/Core/Action/Plugin/Action/UnpublishAction.php \Drupal\Core\Action\Plugin\Action\UnpublishAction::execute()
- 11.x core/lib/Drupal/Core/Action/Plugin/Action/UnpublishAction.php \Drupal\Core\Action\Plugin\Action\UnpublishAction::execute()
Overrides ExecutableInterface::execute
File
-
core/
lib/ Drupal/ Core/ Action/ Plugin/ Action/ UnpublishAction.php, line 21
Class
- UnpublishAction
- Unpublishes an entity.
Namespace
Drupal\Core\Action\Plugin\ActionCode
public function execute($entity = NULL) {
$entity->setUnpublished()
->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.