function element_info_property

Same name in other branches
  1. 7.x includes/common.inc \element_info_property()

Retrieves a single property for the defined element type.

Parameters

$type: An element type as defined by an element plugin.

$property_name: The property within the element type that should be returned.

$default: (Optional) The value to return if the element type does not specify a value for the property. Defaults to NULL.

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::service('element_info')->getInfoProperty() instead.

See also

https://www.drupal.org/node/2235461

File

core/includes/common.inc, line 970

Code

function element_info_property($type, $property_name, $default = NULL) {
    return \Drupal::service('element_info')->getInfoProperty($type, $property_name, $default);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.