1 views_plugin_argument_default_node.inc views_plugin_argument_default_node::get_argument()

Return the default argument.

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

Overrides views_plugin_argument_default::get_argument

File

core/modules/node/views/views_plugin_argument_default_node.inc, line 14
Contains the node from URL argument default plugin.

Class

views_plugin_argument_default_node
Default argument plugin to extract a node via menu_get_object

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);
  }
}