You are here

function domain_views_arguments in Domain Access 5

Implement hook_views_arguments(). Provide a filter that restricts a view to only show nodes from a specific domain (by domain_id). If you pass "current" as the argument, it filters according to the domain the page is being viewed from.

File

domain_views/domain_views.module, line 82
Provides a Views filter for the Domain Access module.

Code

function domain_views_arguments() {
  $arguments = array(
    'domain_access' => array(
      'name' => t('Domain Access: Domain'),
      'handler' => 'domain_views_handler_arg_domain_id',
      // This is the function that handles all the work
      'help' => t('The argument will filter a view to only show nodes from the specified domain.'),
    ),
  );
  return $arguments;
}