user_picture_enabled

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.

File

core/modules/user/user.module, line 130
Enables the user registration and login system.

Code

function user_picture_enabled() {
  $field_definitions = \Drupal::entityManager()->getFieldDefinitions('user', 'user');
  return isset($field_definitions['user_picture']);
}
doc_Drupal
2016-10-29 09:53:18
Comments
Leave a Comment

Please login to continue.