Skip to content
Snippets Groups Projects
Commit 88572e46 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #1988614 by aroq: Adjust hook_options_list_alter() example in...

Issue #1988614 by aroq: Adjust hook_options_list_alter() example in options.api.php to use ->id() instead of ->id.
parent f0aee215
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
...@@ -92,7 +92,7 @@ function hook_options_list($field, $instance, $entity) { ...@@ -92,7 +92,7 @@ function hook_options_list($field, $instance, $entity) {
*/ */
function hook_options_list_alter(array &$options, array $context) { function hook_options_list_alter(array &$options, array $context) {
// Check if this is the field we want to change. // Check if this is the field we want to change.
if ($context['field']->id == 'field_option') { if ($context['field']->id() == 'field_option') {
// Change the label of the empty option. // Change the label of the empty option.
$options['_none'] = t('== Empty =='); $options['_none'] = t('== Empty ==');
} }
......
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