function user_picture_enabled

Same name and namespace in other branches
  1. 11.x core/modules/user/user.module \user_picture_enabled()
  2. 10 core/modules/user/user.module \user_picture_enabled()
  3. 9 core/modules/user/user.module \user_picture_enabled()
  4. 8.9.x core/modules/user/user.module \user_picture_enabled()

Returns whether this site supports the default user picture feature.

This approach preserves compatibility with node/comment templates. Alternate user picture implementations (e.g., Gravatar) should provide their own add/edit/delete forms and populate the 'picture' variable during the preprocess stage.

Deprecated

in drupal:11.5.0 and is removed from drupal:13.0.0. There is no replacement, check the definition directly.

See also

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

File

core/modules/user/user.module, line 29

Code

function user_picture_enabled() {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. There is no replacement, check the definition directly. See https://www.drupal.org/node/3619932', E_USER_DEPRECATED);
  $field_definitions = \Drupal::service('entity_field.manager')->getFieldDefinitions('user', 'user');
  return isset($field_definitions['user_picture']);
}

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