1 book.module book_type_is_allowed($type)

Determine if a given node type is in the list of types allowed for books.

Parameters

string $type: A node type.

Return value

bool: TRUE if the node type can be included in books, FALSE otherwise.

File

core/modules/book/book.module, line 1146
Allows users to create and organize related content in an outline.

Code

function book_type_is_allowed($type) {
  $book_allowed_types = config_get('book.settings', 'book_allowed_types');
  if (!empty($book_allowed_types)) {
    $enabled_types = array_filter($book_allowed_types);
    return in_array($type, $enabled_types);
  }
  return FALSE;
}