You are here

function Node::get_argument in Views (for Drupal 7) 8.3

Return the default argument.

This needs to be overridden by every default argument handler to properly do what is needed.

Overrides ArgumentDefaultPluginBase::get_argument

1 call to Node::get_argument()
Root::get_argument in lib/Views/book/Plugin/views/argument_default/Root.php
Return the default argument.
1 method overrides Node::get_argument()
Root::get_argument in lib/Views/book/Plugin/views/argument_default/Root.php
Return the default argument.

File

lib/Views/node/Plugin/views/argument_default/Node.php, line 27
Definition of Views\node\Plugin\views\argument_default\Node.

Class

Node
Default argument plugin to extract a node via menu_get_object

Namespace

Views\node\Plugin\views\argument_default

Code

function get_argument() {
  foreach (range(1, 3) as $i) {
    $node = menu_get_object('node', $i);
    if (!empty($node)) {
      return $node->nid;
    }
  }
  if (arg(0) == 'node' && is_numeric(arg(1))) {
    return arg(1);
  }
}