function book_type_is_allowed

Same name in other branches
  1. 7.x modules/book/book.module \book_type_is_allowed()
  2. 8.9.x core/modules/book/book.module \book_type_is_allowed()
  3. 10 core/modules/book/book.module \book_type_is_allowed()
  4. 11.x core/modules/book/book.module \book_type_is_allowed()

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

Parameters

string $type: A node type.

Return value

bool A Boolean TRUE if the node type can be included in books; otherwise, FALSE.

2 calls to book_type_is_allowed()
book_form_node_confirm_form_alter in core/modules/book/book.module
Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\Form\NodeDeleteForm.
book_form_node_form_alter in core/modules/book/book.module
Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.

File

core/modules/book/book.module, line 510

Code

function book_type_is_allowed($type) {
    return in_array($type, \Drupal::config('book.settings')->get('allowed_types'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.