Ejemplo n.º 1
0
 /**
  * Updates user avatar
  *
  * @access public
  * @param int $ID
  * @param array $file
  * @return void
  */
 public static function updateAvatar($ID, $file)
 {
     wp_delete_attachment(ThemexCore::getUserMeta($ID, 'avatar'));
     $attachment = ThemexCore::uploadImage($file);
     if (isset($attachment['ID']) && $attachment['ID'] != 0) {
         ThemexCore::updateUserMeta($ID, 'avatar', $attachment['ID']);
     }
 }