Learn Drupal MCQs
Prepare Drupal MCQs (Multiple choice Questions) for exam and job interviews.
Which function is used to get all available themes in Drupal?
1) theme_list()
2) drupal_get_themes()
3) system_theme_list()
4) get_available_themes()
Answer : theme_list()
What is the purpose of the `hook_taxonomy_term_view()` function?
1) Alters the display of taxonomy terms
2) Creates new taxonomy terms
3) Deletes taxonomy terms
4) Manages taxonomy settings
Answer : Manages taxonomy settings
Which command is used to run database updates in Drush?
1) drush updatedb
2) drush db-update
3) drush run-updates
4) drush update-database
Answer : drush updatedb
What does `hook_entity_type_build()` allow you to do?
1) Alter entity types during build
2) Create new entity types
3) Delete entity types
4) Manage entity permissions
Answer : Manage entity permissions
Which file is used to define routing for a custom module?
1) module.routing.yml
2) routes.yml
3) module.routes.yml
4) routing.yml
Answer : module.routes.yml
What does the `hook_form_FORM_ID_alter()` function do?
1) Alters a specific form
2) Creates new forms
3) Deletes forms
4) Manages form submissions
Answer : Deletes forms
What is the purpose of `hook_views_pre_execute()`?
1) Runs before a view is executed
2) Runs after a view is executed
3) Alters the view
4) Creates a new view
Answer : Alters the view
Which command in Drush can be used to list all configuration settings?
1) drush config-list
2) drush config-status
3) drush config-show
4) drush config-export
Answer : drush config-status
What does `hook_field_formatter_info_alter()` allow you to do?
1) Alter field formatters
2) Create new fields
3) Delete field formatters
4) Manage field settings
Answer : Manage field settings
Which function is used to create a new user in Drupal?
1) user_save()
2) drupal_user_create()
3) create_user()
4) new_user()
Answer : drupal_user_create()