diff --git a/core/includes/theme.inc b/core/includes/theme.inc index d128167055f0786710f12a8b72a843a3f54c44c5..13a5154d902c4179b46ecc822fc59da2b02a9783 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1183,10 +1183,10 @@ function template_preprocess_maintenance_task_list(&$variables) { * This function is called for theme hooks implemented as templates only, not * for theme hooks implemented as functions. This preprocess function is the * first in the sequence of preprocessing functions that are called when - * preparing variables for a template. See _theme() for more details about the - * full sequence. + * preparing variables for a template. * - * @see _theme() + * See the @link themeable Default theme implementations topic @endlink for + * details. */ function template_preprocess(&$variables, $hook, $info) { // Tell all templates where they are located. diff --git a/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php index 5e450ab851e0e1925b8f33d89ef1e9ed64ff0315..bb8970737f4bef87a44f8687e24ec29761481b20 100644 --- a/core/lib/Drupal/Core/Theme/Registry.php +++ b/core/lib/Drupal/Core/Theme/Registry.php @@ -298,11 +298,13 @@ public function getBaseHook($hook) { * for base hooks (e.g., 'block__node' for the base hook 'block') need to be * determined based on the full registry and classified as 'base hook'. * - * @see _theme() - * @see hook_theme_registry_alter() + * See the @link themeable Default theme implementations topic @endlink for + * details. * * @return \Drupal\Core\Utility\ThemeRegistry * The build theme registry. + * + * @see hook_theme_registry_alter() */ protected function build() { $cache = array(); diff --git a/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php b/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php index fdc633438b6555bc0deea4b545e28d75cc83f04c..ebbfcb5fb723e3c5ad9313ae85e232f934d31b89 100644 --- a/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php +++ b/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php @@ -18,6 +18,9 @@ interface ThemeManagerInterface { /** * Generates themed output. * + * See the @link themeable Default theme implementations topic @endlink for + * details. + * * @param string $hook * The name of the theme hook to call. * @param array $variables @@ -25,8 +28,6 @@ interface ThemeManagerInterface { * * @return string * The rendered output. - * - * @see _theme */ public function render($hook, array $variables); diff --git a/core/modules/block/block.api.php b/core/modules/block/block.api.php index 7f5269f521a67fff4fe8d849c2fa6d7b4a1f5ee1..afd2beff907553917b69ec83c4f2c3a6d61dad75 100644 --- a/core/modules/block/block.api.php +++ b/core/modules/block/block.api.php @@ -72,8 +72,8 @@ * If the module wishes to act on the rendered HTML of the block rather than * the structured content array, it may use this hook to add a #post_render * callback. Alternatively, it could also implement hook_preprocess_HOOK() for - * block.html.twig. See drupal_render() and _theme() documentation respectively - * for details. + * block.html.twig. See drupal_render() documentation or the + * @link themeable Default theme implementations topic @endlink for details. * * In addition to hook_block_view_alter(), which is called for all blocks, there * is hook_block_view_BASE_BLOCK_ID_alter(), which can be used to target a diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php index ee4d4be1661a2d6a966f7c567da2e237f840c317..95e582236c9e3de18cefbcccf198ff5ab122f7aa 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -1327,7 +1327,9 @@ function hook_ENTITY_TYPE_view(array &$build, \Drupal\Core\Entity\EntityInterfac * structured content array, it may use this hook to add a #post_render * callback. Alternatively, it could also implement hook_preprocess_HOOK() for * the particular entity type template, if there is one (e.g., node.html.twig). - * See drupal_render() and _theme() for details. + * + * See the @link themeable Default theme implementations topic @endlink and + * drupal_render() for details. * * @param array &$build * A renderable array representing the entity content. @@ -1337,10 +1339,10 @@ function hook_ENTITY_TYPE_view(array &$build, \Drupal\Core\Entity\EntityInterfac * The entity view display holding the display options configured for the * entity components. * + * @ingroup entity_crud + * * @see hook_entity_view() * @see hook_ENTITY_TYPE_view_alter() - * - * @ingroup entity_crud */ function hook_entity_view_alter(array &$build, Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) { if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) { @@ -1363,7 +1365,9 @@ function hook_entity_view_alter(array &$build, Drupal\Core\Entity\EntityInterfac * structured content array, it may use this hook to add a #post_render * callback. Alternatively, it could also implement hook_preprocess_HOOK() for * the particular entity type template, if there is one (e.g., node.html.twig). - * See drupal_render() and _theme() for details. + * + * See the @link themeable Default theme implementations topic @endlink and + * drupal_render() for details. * * @param array &$build * A renderable array representing the entity content. @@ -1373,10 +1377,10 @@ function hook_entity_view_alter(array &$build, Drupal\Core\Entity\EntityInterfac * The entity view display holding the display options configured for the * entity components. * + * @ingroup entity_crud + * * @see hook_ENTITY_TYPE_view() * @see hook_entity_view_alter() - * - * @ingroup entity_crud */ function hook_ENTITY_TYPE_view_alter(array &$build, Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) { if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) { diff --git a/core/modules/system/theme.api.php b/core/modules/system/theme.api.php index eef4f5c360d1a1b7f6c8db8e9292ac30c299090d..8eae7f5eed7085e322d943750cd0dae59b56a629 100644 --- a/core/modules/system/theme.api.php +++ b/core/modules/system/theme.api.php @@ -970,12 +970,8 @@ function hook_page_bottom(array &$page_bottom) { /** * Register a module or theme's theme implementations. * - * The implementations declared by this hook have several purposes: - * - They can specify how a particular render array is to be rendered as HTML. - * This is usually the case if the theme function is assigned to the render - * array's #theme property. - * - They can return HTML for default calls to _theme(). - * - They can return HTML for calls to _theme() for a theme suggestion. + * The implementations declared by this hook specify how a particular render + * array is to be rendered as HTML. * * @param array $existing * An array of existing implementations that may be used for override @@ -1001,19 +997,18 @@ function hook_page_bottom(array &$page_bottom) { * * @return array * An associative array of information about theme implementations. The keys - * on the outer array are known as "theme hooks". For simple theme - * implementations for regular calls to _theme(), the theme hook is the first - * argument. For theme suggestions, instead of the array key being the base - * theme hook, the key is a theme suggestion name with the format - * 'base_hook_name__sub_hook_name'. For render elements, the key is the - * machine name of the render element. The array values are themselves arrays - * containing information about the theme hook and its implementation. Each - * information array must contain either a 'variables' element (for _theme() - * calls) or a 'render element' element (for render elements), but not both. + * on the outer array are known as "theme hooks". For theme suggestions, + * instead of the array key being the base theme hook, the key is a theme + * suggestion name with the format 'base_hook_name__sub_hook_name'. + * For render elements, the key is the machine name of the render element. + * The array values are themselves arrays containing information about the + * theme hook and its implementation. Each information array must contain + * either a 'variables' element (for using a #theme element) or a + * 'render element' element (for render elements), but not both. * The following elements may be part of each information array: - * - variables: Used for _theme() call items only: an array of variables, + * - variables: Only used for #theme in render array: an array of variables, * where the array keys are the names of the variables, and the array - * values are the default values if they are not passed into _theme(). + * values are the default values if they are not given in the render array. * Template implementations receive each array key as a variable in the * template file (so they must be legal PHP/Twig variable names). Function * implementations are passed the variables in a single $variables function @@ -1041,7 +1036,7 @@ function hook_page_bottom(array &$page_bottom) { * - function: If specified, this will be the function name to invoke for * this implementation. If neither 'template' nor 'function' are specified, * a default template name will be assumed. See above for more details. - * - base hook: Used for _theme() suggestions only: the base theme hook name. + * - base hook: Used for theme suggestions only: the base theme hook name. * Instead of this suggestion's implementation being used directly, the base * hook will be invoked with this implementation as its first suggestion. * The base hook's files will be included and the base hook's preprocess @@ -1051,14 +1046,17 @@ function hook_page_bottom(array &$page_bottom) { * suggestion may be used in place of this suggestion. If after * hook_theme_suggestions_HOOK() this suggestion remains the first * suggestion, then this suggestion's function or template will be used to - * generate the output for _theme(). + * generate the rendered output. * - pattern: A regular expression pattern to be used to allow this theme * implementation to have a dynamic name. The convention is to use __ to * differentiate the dynamic portion of the theme. For example, to allow * forums to be themed individually, the pattern might be: 'forum__'. Then, - * when the forum is themed, call: + * when the forum is rendered, following render array can be used: * @code - * _theme(array('forum__' . $tid, 'forum'), $forum) + * $render_array = array( + * '#theme' => array('forum__' . $tid, 'forum'), + * '#forum' => $forum, + * ); * @endcode * - preprocess functions: A list of functions used to preprocess this data. * Ordinarily this won't be used; it's automatically filled in. By default, @@ -1078,6 +1076,7 @@ function hook_page_bottom(array &$page_bottom) { * - theme path: (automatically derived) The directory path of the theme or * module, so that it doesn't need to be looked up. * + * @see themeable * @see hook_theme_registry_alter() */ function hook_theme($existing, $type, $theme, $path) {