You are here

function promote_disable_node_presave in Promote Disable 8

Same name and namespace in other branches
  1. 7 promote_disable.module \promote_disable_node_presave()

Implements hook_node_presave().

File

./promote_disable.module, line 41
Primarily Drupal hooks and helper functions.

Code

function promote_disable_node_presave(NodeInterface $node) {

  // Our saved node types.
  $node_types = \Drupal::config('promote_disable.settings')
    ->get('promote_disable_node_types');

  // Is this node type one we've set?
  if (in_array($node
    ->getType(), $node_types)) {
    $node->promote = 0;
  }
}