diff --git a/core/includes/common.inc b/core/includes/common.inc index 9ec0e86..8aa3a8d 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -3758,6 +3758,7 @@ function drupal_render_page($page) { * * @see element_info() * @see _theme() + * @see themeable * @see drupal_process_states() * @see drupal_process_attached() */ diff --git a/core/includes/theme.inc b/core/includes/theme.inc index f98df80..6df52b1 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1838,10 +1838,9 @@ function _theme_table_cell($cell, $header = FALSE) { * 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 themeable */ 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 e84b33b..f7f5629 100644 --- a/core/lib/Drupal/Core/Theme/Registry.php +++ b/core/lib/Drupal/Core/Theme/Registry.php @@ -291,7 +291,7 @@ 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 themeable * @see hook_theme_registry_alter() * * @return \Drupal\Core\Utility\ThemeRegistry diff --git a/core/modules/block/block.api.php b/core/modules/block/block.api.php index 065a1cd..339cdb7 100644 --- a/core/modules/block/block.api.php +++ b/core/modules/block/block.api.php @@ -20,8 +20,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 respectively + * for details. @link themeable Default theme implementations topic @link * * 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/node/node.api.php b/core/modules/node/node.api.php index 1aa1d41..16c117e 100644 --- a/core/modules/node/node.api.php +++ b/core/modules/node/node.api.php @@ -816,8 +816,8 @@ function hook_node_view(\Drupal\node\NodeInterface $node, \Drupal\Core\Entity\Di * If the module wishes to act on the rendered HTML of the node 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 - * node.html.twig. See drupal_render() and _theme() documentation respectively - * for details. + * node.html.twig. See drupal_render() documentation respectively for details. + * @see themeable * * @param $build * A renderable array representing the node content. diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php index 0acf2c3..ff2260a 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -476,7 +476,8 @@ function hook_entity_view(\Drupal\Core\Entity\EntityInterface $entity, \Drupal\C * 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 drupal_render() for details. + * @see themeable * * @param $build * A renderable array representing the entity content. diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 8083f89..e16dfee 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -1025,13 +1025,9 @@ function hook_permission() { /** * 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. + * @see themeable * * @param array $existing * An array of existing implementations that may be used for override @@ -1057,23 +1053,15 @@ function hook_permission() { * * @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 + * a 'render element' element. + * @link themeable Default theme implementations topic @link * The following elements may be part of each information array: - * - variables: Used for _theme() call items only: 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(). - * 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 - * argument. * - render element: Used for render element items only: the name of the * renderable element or element tree to pass to the theme function. This * name is used as the name of the variable that holds the renderable @@ -1091,31 +1079,6 @@ function hook_permission() { * this file; that extension will be added automatically by the default * rendering engine (which is Twig). If 'path' above is specified, the * template should also be in this path. - * - function: If specified, this will be the function name to invoke for - * this implementation. If neither 'template' nor 'function' is specified, - * a default function name will be assumed. For example, if a module - * registers the 'node' theme hook, 'theme_node' will be assigned to its - * function. If the chameleon theme registers the node hook, it will be - * assigned 'chameleon_node' as its function. - * - 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 - * functions will be called in place of any suggestion's preprocess - * functions. If an implementation of hook_theme_suggestions_HOOK() (where - * HOOK is the base hook) changes the suggestion order, a different - * 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(). - * - 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: - * @code - * _theme(array('forum__' . $tid, '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, * for a module this will be filled in as template_preprocess_HOOK. For @@ -1129,8 +1092,6 @@ function hook_permission() { * set, this can be set to true. Please keep in mind that when this is used * by a theme, that theme becomes responsible for making sure necessary * variables are set. - * - type: (automatically derived) Where the theme hook is defined: - * 'module', 'theme_engine', or 'theme'. * - theme path: (automatically derived) The directory path of the theme or * module, so that it doesn't need to be looked up. * diff --git a/core/modules/system/theme.api.php b/core/modules/system/theme.api.php index c86b161..7569e46 100644 --- a/core/modules/system/theme.api.php +++ b/core/modules/system/theme.api.php @@ -107,7 +107,7 @@ * suggestion alter hooks. * * @see drupal_render() - * @see _theme() + * @see themeable * @see hook_theme() * @see hooks * @see callbacks diff --git a/core/modules/taxonomy/taxonomy.api.php b/core/modules/taxonomy/taxonomy.api.php index 1c32203..ff25a86 100644 --- a/core/modules/taxonomy/taxonomy.api.php +++ b/core/modules/taxonomy/taxonomy.api.php @@ -281,8 +281,9 @@ function hook_taxonomy_term_view(\Drupal\taxonomy\Entity\Term $term, \Drupal\Cor * If the module wishes to act on the rendered HTML of the term 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 taxonomy-term.html.twig. See drupal_render() and - * _theme() documentation respectively for details. + * hook_preprocess_HOOK() for taxonomy-term.html.twig. See drupal_render() + * documentation respectively for details. + * @link themeable Default theme implementations topic @link * * @param $build * A renderable array representing the taxonomy term content. diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php index e188bf0..fb47e59 100644 --- a/core/modules/user/user.api.php +++ b/core/modules/user/user.api.php @@ -343,8 +343,8 @@ function hook_user_view(\Drupal\user\UserInterface $account, \Drupal\Core\Entity * If the module wishes to act on the rendered HTML of the user 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 - * user.html.twig. See drupal_render() and _theme() documentation - * respectively for details. + * user.html.twig. See drupal_render() documentation for details. + * @link themeable Default theme implementations topic @link * * @param $build * A renderable array representing the user.