field_widget_instance

function field_widget_instance

field_widget_instance($element, $form_state)

Retrieves the instance definition array for a widget's helper callbacks.

Widgets helper element callbacks (such as #process, #element_validate, #value_callback, ...) should use field_widget_field() and field_widget_instance() instead of field_info_field() and field_info_instance() when they need to access field or instance properties. See hook_field_widget_form() for more details.

Parameters

$element: The structured array for the widget.

$form_state: The form state.

Return value

The $instance definition array for the current widget.

See also

field_widget_field()

hook_field_widget_form()

File

modules/field/field.form.inc, line 601
Field forms management.

Code

function field_widget_instance($element, $form_state) {
  $field_state = field_form_get_state($element['#field_parents'], $element['#field_name'], $element['#language'], $form_state);
  return $field_state['instance'];
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!field.form.inc/function/field_widget_instance/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部