Skip to content
Snippets Groups Projects
Commit 3a0d4373 authored by Jess's avatar Jess
Browse files

Issue #2146045 by D Szkiba, joshi.rohit100, tyler.frankenstein,...

Issue #2146045 by D Szkiba, joshi.rohit100, tyler.frankenstein, er.pushpinderrana, dajjen, jhodgdon, joachim: Document Field API allowed_values_function callback
parent 21b27e3b
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -26,6 +26,7 @@
* - entity: The entity object the field is attached to
* (\Drupal\Core\Entity\EntityInterface).
*
* @ingroup hooks
* @see hook_options_list()
*/
function hook_options_list_alter(array &$options, array $context) {
......@@ -42,7 +43,7 @@ function hook_options_list_alter(array &$options, array $context) {
* Callback for options_allowed_values().
*
* 'list_*' fields can specify a callback to define the set of their allowed
* values using the 'allowed_values_callback' storage setting.
* values using the 'allowed_values_function' storage setting.
*
* That function will be called:
* - either in the context of a specific entity, which is then provided as the
......@@ -74,6 +75,7 @@ function hook_options_list_alter(array &$options, array $context) {
* any context so that other code (e.g. Views filters) can support the allowed
* values for all possible entities and bundles.
*
* @ingroup callbacks
* @see options_allowed_values()
* @see options_test_allowed_values_callback()
* @see options_test_dynamic_values_callback()
......
......@@ -9,7 +9,7 @@
use Drupal\Core\Field\FieldStorageDefinitionInterface;
/**
* Allowed values callback.
* Implements callback_allowed_values_function().
*
* @see options_allowed_values().
*/
......@@ -31,7 +31,7 @@ function options_test_allowed_values_callback(FieldStorageDefinitionInterface $d
}
/**
* An entity-bound allowed values callback.
* Implements callback_allowed_values_function().
*
* @todo This function violates the recommendation in options_allowed_values()
* to return a list of all possible values in any context when $items is
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment