Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

In Drupal 7, field_widget_behavior() was a helper function to provide quick access to "the properties in the 'behavior' entry in the definition info of the widget currently configured by a field $instance".

Changes in Drupal 8 have made this function irrelevant:
- There is no 'behavior' entry in widget plugin definitions anymore
- The introduction of "form modes" means there is no single widget associated to a field $instance anymore.
The function has thus been removed from Drupal 8.

Code that might need to access the plugin definition of a widget used in a form mode can do:

<?php
$options
= entity_get_form_display($entity_type, $bundle, $form_mode)->getComponent($field_name);
$plugin_definition = \Drupal::service('plugin.manager.field.widget')->getDefinition($options['type']);
?>
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done