function 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']);
}

© 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/core!modules!user!user.module/function/user_picture_enabled/8.1.x