DRUPALとは Drupalとは、2001年に誕生した、PHP製のオープンソースのコンテンツ管理システム(CMS)です。世界中で100万以上のサイトで稼働していると言われており、海外だとNASAやオーストラリア政府、また、NASDAQなどの金融機関、ネスレ、ジョンソン・エンド・ジョンソンなどのグローバル企業がDrupalを採用しています。
HOOKとは Drupal におけるフック( hooks )とは、「 Drupal のモジュールが他のモジュールや Drupal のコアとの間でやりとりをするための仕組み 」のことです。
具体的には、指定されたパターンの名前の関数を書けばそれが「フック関数」として認識され所定の場所で呼び出される という仕組みになっています。
How to invoke a new hook in a Drupal module (and add yourself to a round of beer) https://befused.com/drupal/invoke-hook/
By Blair Wadman
So, you want to allow other modules to hook into your own module. You may have implemented hooks that other modules provide, but does invoking your own hook for a module seem like a dark art? It is as simple as calling one function in your module. All will be revealed shortly, but first, lets look at why you would want to invoke your own hook.
What is invoking a hook? When you invoke a hook, you are registering a new hook with Drupal that allows other modules to implement and therefore interact with your module. You are providing hook in points in your module which say to other modules “here is a point where you can inject your own data or extend my module”.
Why invoke hooks? The hook system is at the heart of what makes Drupal powerful. All modules will use hooks to interact with the rest of the Drupal system. By invoking your own hook, you are making your module more powerful and useful because you are allowing other modules to extend it or change its data in some way. If no module invoked hooks, there would be no hooks for you to implement! If it still does not make sense, don’t worry, as the best way to understand it is with an example.
Beer round example Let’s take a really simple example. Imagine you have a module with some code which returns a list of people included in a round of beer. And then you want to invoke your own hook so that other modules can add to the list of names that are part of the beer round.
Let’s set the module up before invoking the hook. The module is called beer_round . In beer_round.module you firstly need to implement hook_menu() to define the path where we can see the list of names for the beer round.
/**
* Implements hook_menu.
*/
function beer_round_menu() {
$items = array();
$items['beer'] = array(
'title' => 'Beer round',
'page callback' => 'beer_round_callback',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
This snippet simply means, when the user goes to the path beer, call the callback function called beer_round_callback(). Anyone who has the access content permission has the necessary permissions to view this page.
Next you need to define the callback function.
/**
* List of people included in a round of beer.
*/
function beer_round_callback() {
$round = array('Dave', 'Paolo', 'Andrew', 'Mat', 'Paula', 'Mihhail', 'Pete', 'Dima', 'Bhavna', 'Laura', 'Steve', 'San', 'Nick');
$output = theme('item_list', array('items' => $round));
return $output;
}
This contains an array of names of people who are part of the beer round. You then pass that array into the theme() function, which will convert it into an unordered list. If you now hit the path beer, you will see the list of names.
Now it is time to invoke a new hook. To invoke a new hook, all you need to do is call module_invoke_all() and pass in the name of the hook. We will call the hook beer_round. So you will call module_invoke_all(‘beer_round’) and add the result to the array of people in the round.
/**
* List of people included in a round of beer.
*/
function beer_round_callback() {
$round = array('Dave', 'Paolo', 'Andrew', 'Mat', 'Paula', 'Mihhail', 'Pete', 'Dima', 'Bhavna', 'Laura', 'Steve', 'San', 'Nick');
$round_more = module_invoke_all('beer_round');
$round_all = array_merge($round, $round_more);
$output = theme('item_list', array('items' => $round_all));
return $output;
}
Drupal will check every module to see if hook_beer_round has been implemented. If it has, the data the modules provide will be added to $round_more, which will be an array. If two modules implement hook_beer_round(), the array will contain two elements. So now we have two arrays, the original array of people in the beer round, and the additional people added via the hook. So merge the two together with array_merge() , and you have the full round.
To see this in action, implement hook_beer_round() in another module. I have a module called ‘blair’ where I will add myself to the beer round.
My implementation of hook_beer_round is:
/**
* Implements hook_beer_round();
*/
function blair_beer_round() {
return 'Blair';
}
Now if you reload the beer page, you will see that my name has been added.
That is all there is to invoking a hook! This is a very simple example to get you started. I will go into a more advanced example in a future post.
Note: real names are used in the example, but nobody was harmed in the production of this tutorial.
Overview of invoking a hook
参考
How to invoke a new hook in a Drupal module (and add yourself to a round of beer)
So, you want to allow other modules to hook into your own module. You may have implemented hooks that other modules provide, but does invoking your own hook for...
名前 説明 場所 Version hook_block_access Control access to a block instance. core/modules/block/block.api.php d10,d9,d8 hook_block_alter Allow modules to alter the block plugin definitions. core/modules/block/block.api.php d10,d9,d8 hook_block_build_alter Alter the result of DrupalCoreBlockBlockBase::build(). core/modules/block/block.api.php d10,d9,d8 hook_block_build_BASE_BLOCK_ID_alter Provide a block plugin specific block_build alteration. core/modules/block/block.api.php d10,d9,d8 hook_block_view_BASE_BLOCK_ID_alter Provide a block plugin specific block_view alteration. core/modules/block/block.api.php d10,d9,d8 hook_cache_flush Flush all persistent and static caches. core/core.api.php d10,d9,d8 hook_ckeditor4to5upgrade_plugin_info_alter Modify the list of available CKEditor 4 to 5 Upgrade plugins. core/modules/ckeditor5/ckeditor5.api.php d10,d9,d8 hook_ckeditor5_plugin_info_alter Modify the list of available CKEditor 5 plugins. core/modules/ckeditor5/ckeditor5.api.php d10,d9,d8 hook_comment_links_alter Alter the links of a comment. core/modules/comment/comment.api.php d10,d9,d8 hook_config_import_steps_alter Alter the configuration synchronization steps. core/core.api.php d10,d9,d8 hook_config_schema_info_alter Alter config typed data definitions. core/core.api.php d10,d9,d8 hook_config_translation_info Introduce dynamic translation tabs for translation of configuration. core/modules/config_translation/config_translation.api.php d10,d9,d8 hook_config_translation_info_alter Alter existing translation tabs for translation of configuration. core/modules/config_translation/config_translation.api.php d10,d9,d8 hook_contextual_links_alter Alter contextual links before they are rendered. core/lib/Drupal/Core/Menu/menu.api.php d10,d9,d8 hook_contextual_links_plugins_alter Alter the plugin definition of contextual links. core/lib/Drupal/Core/Menu/menu.api.php d10,d9,d8 hook_data_type_info_alter Alter available data types for typed data wrappers. core/core.api.php d10,d9,d8 hook_display_variant_plugin_alter Alter display variant plugin definitions. core/core.api.php d10,d9,d8 hook_editor_info_alter Performs alterations on text editor definitions. core/modules/editor/editor.api.php d10,d9,d8 hook_editor_js_settings_alter Modifies JavaScript settings that are added for text editors. core/modules/editor/editor.api.php d10,d9,d8 hook_editor_xss_filter_alter Modifies the text editor XSS filter that will used for the given text format. core/modules/editor/editor.api.php d10,d9,d8 hook_element_plugin_alter Alter Element plugin definitions. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_entity_access Control entity operation access. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_base_field_info Provides custom base field definitions for a content entity type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_base_field_info_alter Alter base field definitions for a content entity type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_build_defaults_alter Alter entity renderable values before cache checking during rendering. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_bundle_create Act on entity_bundle_create(). core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_bundle_delete Act on entity_bundle_delete(). core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_bundle_field_info Provides field definitions for a specific bundle within an entity type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_bundle_field_info_alter Alter bundle field definitions. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_bundle_info Describe the bundles for entity types. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_bundle_info_alter Alter the bundles for entity types. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_create Acts when creating a new entity. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_create_access Control entity create access. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_display_build_alter Alter the render array generated by an EntityDisplay for an entity. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_extra_field_info Exposes "pseudo-field" components on content entities. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_extra_field_info_alter Alter "pseudo-field" components on content entities. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_field_access Control access to fields. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_field_access_alter Alter the default access behavior for a given field. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_field_storage_info Provides field storage definitions for a content entity type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_field_storage_info_alter Alter field storage definitions for a content entity type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_field_values_init Acts when initializing a fieldable entity object. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_form_display_alter Alter the settings used for displaying an entity form. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_form_mode_alter Change the form mode used to build an entity form. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_operation Declares entity operations. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_operation_alter Alter entity operations. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_predelete Act before entity deletion. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_preload Act on an array of entity IDs before they are loaded. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_prepare_form Acts on an entity object about to be shown on an entity form. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_revision_create Respond to entity revision creation. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_revision_delete Respond to entity revision deletion. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_storage_load Act on content entities when loaded from the storage. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_translation_create Acts when creating a new entity translation. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_translation_delete Respond to entity translation deletion. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_translation_insert Respond to creation of a new entity translation. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_access Control entity operation access for a specific entity type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_type_alter Alter the entity type definitions. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_type_build Add to entity type definitions. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_build_defaults_alter Alter entity renderable values before cache checking during rendering. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_create Acts when creating a new entity of a specific type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_create_access Control entity create access for a specific entity type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_delete Respond to entity deletion of a particular type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_field_values_init Acts when initializing a fieldable entity object. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_insert Respond to creation of a new entity of a particular type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_load Act on entities of a specific type when loaded. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_predelete Act before entity deletion of a particular entity type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_prepare_form Acts on a particular type of entity object about to be in an entity form. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_presave Act on a specific type of entity before it is created or updated. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_revision_create Respond to entity revision creation. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_revision_delete Respond to entity revision deletion of a particular type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_storage_load Act on content entities of a given type when loaded from the storage. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_translation_create Acts when creating a new entity translation of a specific type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_translation_delete Respond to entity translation deletion of a particular type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_translation_insert Respond to creation of a new entity translation of a particular type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_update Respond to updates to an entity of a particular type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_view Act on entities of a particular type being assembled before rendering. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_ENTITY_TYPE_view_alter Alter the results of the entity build array for a particular entity type. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_view_display_alter Alter the settings used for displaying an entity. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_entity_view_mode_info_alter Alter the view modes for entity types. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8 hook_extension Declare a template file extension to be used with a theme engine. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_field_purge_field_storage Acts when a field storage definition is being purged. core/modules/field/field.api.php d10,d9,d8 hook_field_storage_config_update_forbid Forbid a field storage update from occurring. core/modules/field/field.api.php d10,d9,d8 hook_field_ui_preconfigured_options_alter Perform alterations on preconfigured field options. core/modules/field/field.api.php d10,d9,d8 hook_field_views_data Override the default Views data for a Field API field. core/modules/views/views.api.php d10,d9,d8 hook_field_views_data_alter Alter the Views data for a single Field API field. core/modules/views/views.api.php d10,d9,d8 hook_field_views_data_views_data_alter Alter the Views data on a per field basis. core/modules/views/views.api.php d10,d9,d8 hook_field_widget_complete_form_alter Alter the complete form for field widgets provided by other modules. core/modules/field/field.api.php d10,d9,d8 hook_field_widget_complete_WIDGET_TYPE_form_alter Alter the complete form for a specific widget provided by other modules. core/modules/field/field.api.php d10,d9,d8 hook_field_widget_single_element_form_alter Alter forms for field widgets provided by other modules. core/modules/field/field.api.php d10,d9,d8 hook_field_widget_single_element_WIDGET_TYPE_form_alter Alter widget forms for a specific widget provided by another module. core/modules/field/field.api.php d10,d9,d8 hook_filter_secure_image_alter Alters images with an invalid source. core/modules/filter/filter.api.php d10,d9,d8 hook_form_system_theme_settings_alter Allow themes to alter the theme-specific settings form. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_help_section_info_alter Perform alterations on help page section plugin definitions. core/modules/help/help.api.php d10,d9,d8 hook_help_topics_info_alter Perform alterations on help topic definitions. core/modules/help_topics/help_topics.api.php d10,d9,d8 hook_js_settings_alter Perform necessary alterations to the JavaScript settings (drupalSettings). core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_js_settings_build Modify the JavaScript settings (drupalSettings). core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_jsonapi_entity_field_filter_access Restricts filtering access to the given field. core/modules/jsonapi/jsonapi.api.php d10,d9,d8 hook_jsonapi_entity_filter_access Controls access when filtering by entity data via JSON:API. core/modules/jsonapi/jsonapi.api.php d10,d9,d8 hook_jsonapi_ENTITY_TYPE_filter_access Controls access to filtering by entity data via JSON:API. core/modules/jsonapi/jsonapi.api.php d10,d9,d8 hook_language_fallback_candidates_OPERATION_alter Allow modules to alter the fallback candidates for specific operations. core/modules/language/language.api.php d10,d9,d8 hook_layout_alter Allow modules to alter layout plugin definitions. core/core.api.php d10,d9,d8 hook_library_info_alter Alter libraries provided by an extension. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_library_info_build Add dynamic library definitions. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_link_alter Alter the parameters for links. core/lib/Drupal/Core/Menu/menu.api.php d10,d9,d8 hook_local_tasks_alter Alter local tasks plugins. core/lib/Drupal/Core/Menu/menu.api.php d10,d9,d8 hook_locale_translation_projects_alter Alter the list of projects to be updated by locale's interface translation. core/modules/locale/locale.api.php d10,d9,d8 hook_mail_backend_info_alter Alter the list of mail backend plugin definitions. core/core.api.php d10,d9,d8 hook_media_source_info_alter Alters the information provided in DrupalmediaAnnotationMediaSource. core/modules/media/media.api.php d10,d9,d8 hook_menu_links_discovered_alter Alters all the menu links discovered by the menu link plugin manager. core/lib/Drupal/Core/Menu/menu.api.php d10,d9,d8 hook_menu_local_actions_alter Alter local actions plugins. core/lib/Drupal/Core/Menu/menu.api.php d10,d9,d8 hook_migrate_MIGRATION_ID_prepare_row Allows adding data to a row for a migration with the specified ID. core/modules/migrate/migrate.api.php d10,d9,d8 hook_migrate_prepare_row Allows adding data to a row before processing it. core/modules/migrate/migrate.api.php d10,d9,d8 hook_migration_plugins_alter Allows altering the list of discovered migration plugins. core/modules/migrate/migrate.api.php d10,d9,d8 hook_module_preinstall Perform necessary actions before a module is installed. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8 hook_module_preuninstall Perform necessary actions before a module is uninstalled. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8 hook_node_links_alter Alter the links of a node. core/modules/node/node.api.php d10,d9,d8 hook_oembed_resource_url_alter Alters an oEmbed resource URL before it is fetched. core/modules/media/media.api.php d10,d9,d8 hook_options_list_alter Alters the list of options to be displayed for a field. core/modules/options/options.api.php d10,d9,d8 hook_page_attachments Add attachments (typically assets) to a page before it is rendered. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_page_attachments_alter Alter attachments (typically assets) to a page before it is rendered. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_page_bottom Add a renderable array to the bottom of the page. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_page_top Add a renderable array to the top of the page. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_plugin_filter_TYPE__CONSUMER_alter Alter the filtering of plugin definitions for a specific type and consumer. core/lib/Drupal/Core/Plugin/plugin.api.php d10,d9,d8 hook_plugin_filter_TYPE_alter Alter the filtering of plugin definitions for a specific plugin type. core/lib/Drupal/Core/Plugin/plugin.api.php d10,d9,d8 hook_post_update_NAME Executes an update which is intended to update data, like entities. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8 hook_preprocess Preprocess theme variables for templates. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_preprocess_HOOK Preprocess theme variables for a specific theme hook. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_queue_info_alter Alter cron queue information before cron runs. core/core.api.php d10,d9,d8 hook_rebuild Rebuild data based upon refreshed caches. core/core.api.php d10,d9,d8 hook_removed_post_updates Return an array of removed hook_post_update_NAME() function names. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8 hook_render_template Render a template using the theme engine. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_requirements_alter Alters requirements data. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8 hook_rest_resource_alter Alter the resource plugin definitions. core/modules/rest/rest.api.php d10,d9,d8 hook_search_plugin_alter Alter search plugin definitions. core/modules/search/search.api.php d10,d9,d8 hook_system_breadcrumb_alter Perform alterations to the breadcrumb built by the BreadcrumbManager. core/lib/Drupal/Core/Menu/menu.api.php d10,d9,d8 hook_template_preprocess_default_variables_alter Alter the default, hook-independent variables for all templates. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_theme_suggestions_alter Alters named suggestions for all theme hooks. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_theme_suggestions_HOOK Provides alternate named suggestions for a specific theme hook. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_theme_suggestions_HOOK_alter Alters named suggestions for a specific theme hook. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_themes_installed Respond to themes being installed. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_themes_uninstalled Respond to themes being uninstalled. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8 hook_toolbar Add items to the toolbar menu. core/modules/toolbar/toolbar.api.php d10,d9,d8 hook_toolbar_alter Alter the toolbar menu after hook_toolbar() is invoked. core/modules/toolbar/toolbar.api.php d10,d9,d8 hook_tour_tips_alter Allow modules to alter tour items before render. core/modules/tour/tour.api.php d10,d9,d8 hook_tour_tips_info_alter Allow modules to alter tip plugin definitions. core/modules/tour/tour.api.php d10,d9,d8 hook_transliteration_overrides_alter Provide language-specific overrides for transliteration. core/lib/Drupal/Core/Language/language.api.php d10,d9,d8 hook_user_format_name_alter Alter the username that is displayed for a user. core/modules/user/user.api.php d10,d9,d8 hook_validation_constraint_alter Alter validation constraint plugin definitions. core/core.api.php d10,d9,d8 hook_views_analyze Analyze a view to provide warnings about its configuration. core/modules/views/views.api.php d10,d9,d8 hook_views_data Describe data tables and fields (or the equivalent) to Views. core/modules/views/views.api.php d10,d9,d8 hook_views_data_alter Alter the table and field information from hook_views_data(). core/modules/views/views.api.php d10,d9,d8 hook_views_form_substitutions Replace special strings when processing a view with form elements. core/modules/views/views.api.php d10,d9,d8 hook_views_invalidate_cache Allow modules to respond to the invalidation of the Views cache. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_access_alter Modify the list of available views access plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_area_alter Modify the list of available views area handler plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_argument_alter Modify the list of available views argument handler plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_argument_default_alter Modify the list of available views default argument plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_argument_validator_alter Modify the list of available views argument validation plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_cache_alter Modify the list of available views cache plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_display_alter Modify the list of available views display plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_display_extenders_alter Modify the list of available views display extender plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_exposed_form_alter Modify the list of available views exposed form plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_field_alter Modify the list of available views field handler plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_filter_alter Modify the list of available views filter handler plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_join_alter Modify the list of available views join plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_pager_alter Modify the list of available views pager plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_query_alter Modify the list of available views query plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_relationship_alter Modify the list of available views relationship handler plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_row_alter Modify the list of available views row plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_sort_alter Modify the list of available views sort handler plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_style_alter Modify the list of available views style plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_plugins_wizard_alter Modify the list of available views wizard plugins. core/modules/views/views.api.php d10,d9,d8 hook_views_post_build Act on the view immediately after the query is built. core/modules/views/views.api.php d10,d9,d8 hook_views_post_execute Act on the view immediately after the query has been executed. core/modules/views/views.api.php d10,d9,d8 hook_views_post_render Post-process any render data. core/modules/views/views.api.php d10,d9,d8 hook_views_pre_build Act on the view before the query is built, but after displays are attached. core/modules/views/views.api.php d10,d9,d8 hook_views_pre_execute Act on the view after the query is built and just before it is executed. core/modules/views/views.api.php d10,d9,d8 hook_views_pre_render Act on the view immediately before rendering it. core/modules/views/views.api.php d10,d9,d8 hook_views_pre_view Alter a view at the very beginning of Views processing. core/modules/views/views.api.php d10,d9,d8 hook_views_preview_info_alter Alter the view preview information. core/modules/views/views.api.php d10,d9,d8 hook_views_query_alter Alter the query before it is executed. core/modules/views/views.api.php d10,d9,d8 hook_views_query_substitutions Replace special strings in the query before it is executed. core/modules/views/views.api.php d10,d9,d8 hook_views_ui_display_tab_alter Alter the renderable array representing the edit page for one display. core/modules/views_ui/views_ui.api.php d10,d9,d8 hook_views_ui_display_top_alter Alter the top of the display for the Views UI. core/modules/views_ui/views_ui.api.php d10,d9,d8 hook_views_ui_display_top_links_alter Alter the links displayed at the top of the view edit form. core/modules/views_ui/views_ui.api.php d10,d9,d8 hook_ajax_render_alter Alter the Ajax command data that is sent to the client. core/lib/Drupal/Core/Form/form.api.php d10,d9,d8,d7 hook_archiver_info_alter Alter archiver information declared by other modules. core/lib/Drupal/Core/File/file.api.php d10,d9,d8,d7 hook_batch_alter Alter batch information before a batch is processed. core/lib/Drupal/Core/Form/form.api.php d10,d9,d8,d7 hook_block_view_alter Alter the result of DrupalCoreBlockBlockBase::build(). core/modules/block/block.api.php d10,d9,d8,d7 hook_contextual_links_view_alter Alter a contextual links element before it is rendered. core/modules/contextual/contextual.api.php d10,d9,d8,d7 hook_countries_alter Alter the default country list. core/core.api.php d10,d9,d8,d7 hook_cron Perform periodic actions. core/core.api.php d10,d9,d8,d7 hook_css_alter Alter CSS files before they are output on the page. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8,d7 hook_element_info_alter Alter the element type information returned from modules. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8,d7 hook_entity_delete Respond to entity deletion. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8,d7 hook_entity_insert Respond to creation of a new entity. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8,d7 hook_entity_load Act on entities when loaded. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8,d7 hook_entity_prepare_view Act on entities as they are being prepared for view. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8,d7 hook_entity_presave Act on an entity before it is created or updated. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8,d7 hook_entity_update Respond to updates to an entity. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8,d7 hook_entity_view Act on entities being assembled before rendering. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8,d7 hook_entity_view_alter Alter the results of the entity build array. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8,d7 hook_entity_view_mode_alter Change the view mode of an entity that is being displayed. core/lib/Drupal/Core/Entity/entity.api.php d10,d9,d8,d7 hook_field_formatter_info_alter Perform alterations on Field API formatter types. core/modules/field/field.api.php d10,d9,d8,d7 hook_field_info_alter Perform alterations on Field API field types. core/modules/field/field.api.php d10,d9,d8,d7 hook_field_info_max_weight Returns the maximum weight for the entity components handled by the module. core/modules/field/field.api.php d10,d9,d8,d7 hook_field_purge_field Acts when a field is being purged. core/modules/field/field.api.php d10,d9,d8,d7 hook_field_widget_info_alter Perform alterations on Field API widget types. core/modules/field/field.api.php d10,d9,d8,d7 hook_file_copy Respond to a file that has been copied. core/modules/file/file.api.php d10,d9,d8,d7 hook_file_download Control access to private file downloads and specify HTTP headers. core/lib/Drupal/Core/File/file.api.php d10,d9,d8,d7 hook_file_mimetype_mapping_alter Alter MIME type mappings used to determine MIME type from a file extension. core/lib/Drupal/Core/File/file.api.php d10,d9,d8,d7 hook_file_move Respond to a file that has been moved. core/modules/file/file.api.php d10,d9,d8,d7 hook_file_url_alter Alter the URL to a file. core/lib/Drupal/Core/File/file.api.php d10,d9,d8,d7 hook_file_validate Check that files meet a given criteria. core/modules/file/file.api.php d10,d9,d8,d7 hook_filetransfer_info Register information about FileTransfer classes provided by a module. core/lib/Drupal/Core/File/file.api.php d10,d9,d8,d7 hook_filetransfer_info_alter Alter the FileTransfer class registry. core/lib/Drupal/Core/File/file.api.php d10,d9,d8,d7 hook_filter_format_disable Perform actions when a text format has been disabled. core/modules/filter/filter.api.php d10,d9,d8,d7 hook_filter_info_alter Perform alterations on filter definitions. core/modules/filter/filter.api.php d10,d9,d8,d7 hook_form_alter Perform alterations before a form is rendered. core/lib/Drupal/Core/Form/form.api.php d10,d9,d8,d7 hook_form_BASE_FORM_ID_alter Provide a form-specific alteration for shared ('base') forms. core/lib/Drupal/Core/Form/form.api.php d10,d9,d8,d7 hook_form_FORM_ID_alter Provide a form-specific alteration instead of the global hook_form_alter(). core/lib/Drupal/Core/Form/form.api.php d10,d9,d8,d7 hook_help Provide online user help. core/modules/help/help.api.php d10,d9,d8,d7 hook_hook_info Defines one or more hooks that are exposed by a module. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_image_effect_info_alter Alter the information provided in DrupalimageAnnotationImageEffect. core/modules/image/image.api.php d10,d9,d8,d7 hook_image_style_flush Respond to image style flushing. core/modules/image/image.api.php d10,d9,d8,d7 hook_install Perform setup tasks when the module is installed. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_install_tasks Return an array of tasks to be performed by an installation profile. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_install_tasks_alter Alter the full list of installation tasks. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_js_alter Perform necessary alterations to the JavaScript before it is presented on the page. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8,d7 hook_language_fallback_candidates_alter Allow modules to alter the language fallback candidates. core/modules/language/language.api.php d10,d9,d8,d7 hook_language_negotiation_info_alter Perform alterations on language negotiation methods. core/modules/language/language.api.php d10,d9,d8,d7 hook_language_switch_links_alter Perform alterations on language switcher links. core/lib/Drupal/Core/Language/language.api.php d10,d9,d8,d7 hook_language_types_info Define language types. core/modules/language/language.api.php d10,d9,d8,d7 hook_language_types_info_alter Perform alterations on language types. core/modules/language/language.api.php d10,d9,d8,d7 hook_mail Prepares a message based on parameters. core/core.api.php d10,d9,d8,d7 hook_mail_alter Alter an email message created with MailManagerInterface->mail(). core/core.api.php d10,d9,d8,d7 hook_menu_local_tasks_alter Alter local tasks displayed on the page before they are rendered. core/lib/Drupal/Core/Menu/menu.api.php d10,d9,d8,d7 hook_module_implements_alter Alter the registry of modules implementing a hook. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_modules_installed Perform necessary actions after modules are installed. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_modules_uninstalled Perform necessary actions after modules are uninstalled. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_node_access_records Set permissions for a node to be written to the database. core/modules/node/node.api.php d10,d9,d8,d7 hook_node_access_records_alter Alter permissions for a node before it is written to the database. core/modules/node/node.api.php d10,d9,d8,d7 hook_node_grants Inform the node access system what permissions the user has. core/modules/node/node.api.php d10,d9,d8,d7 hook_node_grants_alter Alter user access rules when trying to view, edit or delete a node. core/modules/node/node.api.php d10,d9,d8,d7 hook_node_search_result Act on a node being displayed as a search result. core/modules/node/node.api.php d10,d9,d8,d7 hook_node_update_index Act on a node being indexed for searching. core/modules/node/node.api.php d10,d9,d8,d7 hook_query_alter Perform alterations to a structured query. core/lib/Drupal/Core/Database/database.api.php d10,d9,d8,d7 hook_query_TAG_alter Perform alterations to a structured query for a given tag. core/lib/Drupal/Core/Database/database.api.php d10,d9,d8,d7 hook_ranking Provide additional methods of scoring for core search results for nodes. core/modules/node/node.api.php d10,d9,d8,d7 hook_requirements Check installation requirements and do status reporting. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_schema Define the current version of the database schema. core/lib/Drupal/Core/Database/database.api.php d10,d9,d8,d7 hook_search_preprocess Preprocess text for search. core/modules/search/search.api.php d10,d9,d8,d7 hook_shortcut_default_set Return the name of a default shortcut set for the provided user account. core/modules/shortcut/shortcut.api.php d10,d9,d8,d7 hook_system_info_alter Alter the information parsed from module and theme .info.yml files. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_system_themes_page_alter Alters theme operation links. core/modules/system/system.api.php d10,d9,d8,d7 hook_theme Register a module or theme's theme implementations. core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8,d7 hook_theme_registry_alter Alter the theme registry information returned from hook_theme(). core/lib/Drupal/Core/Render/theme.api.php d10,d9,d8,d7 hook_token_info Provide information about available placeholder tokens and token types. core/lib/Drupal/Core/Utility/token.api.php d10,d9,d8,d7 hook_token_info_alter Alter the metadata about available placeholder tokens and token types. core/lib/Drupal/Core/Utility/token.api.php d10,d9,d8,d7 hook_tokens Provide replacement values for placeholder tokens. core/lib/Drupal/Core/Utility/token.api.php d10,d9,d8,d7 hook_tokens_alter Alter replacement values for placeholder tokens. core/lib/Drupal/Core/Utility/token.api.php d10,d9,d8,d7 hook_uninstall Remove any information that the module sets. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_update_dependencies Return an array of information about module update dependencies. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_update_last_removed Return a number which is no longer available as hook_update_N(). core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_update_N Perform a single update between minor versions. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_update_projects_alter Alter the list of projects before fetching data and comparing versions. core/modules/update/update.api.php d10,d9,d8,d7 hook_update_status_alter Alter the information about available updates for projects. core/modules/update/update.api.php d10,d9,d8,d7 hook_updater_info Provide information on Updaters (classes that can update Drupal). core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_updater_info_alter Alter the Updater information array. core/lib/Drupal/Core/Extension/module.api.php d10,d9,d8,d7 hook_user_cancel Act on user account cancellations. core/modules/user/user.api.php d10,d9,d8,d7 hook_user_cancel_methods_alter Modify account cancellation methods. core/modules/user/user.api.php d10,d9,d8,d7 hook_user_login The user just logged in. core/modules/user/user.api.php d10,d9,d8,d7 hook_user_logout The user just logged out. core/modules/user/user.api.php d10,d9,d8,d7 hook_verify_update_archive Verify an archive after it has been downloaded and extracted. core/modules/update/update.api.php d10,d9,d8,d7 hook_aggregator_fetcher_info_alter Perform alterations on the available fetchers. core/modules/aggregator/aggregator.api.php d9 hook_aggregator_parser_info_alter Perform alterations on the available parsers. core/modules/aggregator/aggregator.api.php d9 hook_aggregator_processor_info_alter Perform alterations on the available processors. core/modules/aggregator/aggregator.api.php d9 hook_ckeditor_css_alter Modify the list of CSS files that will be added to a CKEditor instance. core/modules/ckeditor/ckeditor.api.php d9 hook_ckeditor_plugin_info_alter Modify the list of available CKEditor plugins. core/modules/ckeditor/ckeditor.api.php d9 hook_field_widget_form_alter-deprecated Alter forms for field widgets provided by other modules. core/modules/field/field.api.php d9 hook_field_widget_multivalue_form_alter-deprecated Alter forms for multi-value field widgets provided by other modules. core/modules/field/field.api.php d9 hook_field_widget_multivalue_widget_type_form_alter-deprecated Alter multi-value widget forms for a widget provided by another module. core/modules/field/field.api.php d9 hook_field_widget_widget_type_form_alter-deprecated Alter widget forms for a specific widget provided by another module. core/modules/field/field.api.php d9 hook_hal_relation_uri_alter Alter the HAL relation URI. core/modules/hal/hal.api.php d9 hook_hal_type_uri_alter Alter the HAL type URI. core/modules/hal/hal.api.php d9 hook_quickedit_editor_alter Allow modules to alter in-place editor plugin metadata. core/modules/quickedit/quickedit.api.php d9 hook_quickedit_render_field Returns a renderable array for the value of a single field in an entity. core/modules/quickedit/quickedit.api.php d9 hook_rdf_namespaces Allow modules to define namespaces for RDF mappings. core/modules/rdf/rdf.api.php d9,d7