Index: src/wp-includes/pluggable.php
===================================================================
--- src/wp-includes/pluggable.php	(revision 38337)
+++ src/wp-includes/pluggable.php	(working copy)
@@ -2237,7 +2237,7 @@
  *
  * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
  *                           user email, WP_User object, WP_Post object, or WP_Comment object.
- * @param int    $size       Optional. Height and width of the avatar image file in pixels. Default 96.
+ * @param int|string $size   Optional. Height and width of the avatar image file in pixels. Default 96.
  * @param string $default    Optional. URL for the default image or a default type. Accepts '404'
  *                           (return a 404 instead of a default image), 'retro' (8bit), 'monsterid'
  *                           (monster), 'wavatar' (cartoon face), 'indenticon' (the "quilt"),
@@ -2264,9 +2264,24 @@
  * @return false|string `<img>` tag for the user's avatar. False on failure.
  */
 function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = null ) {
+	// Check first for native WordPress image sizes.
+	if ( is_string( $size ) ) {
+		if ( in_array( $size, get_intermediate_image_sizes() ) ) {
+			$dimensions = [
+				'height' => get_option( "{$size}_size_h" ),
+				'width'  => get_option( "{$size}_size_w" ),
+			];
+
+			$size = (int) $dimensions['height'] > $dimensions['width'] ? $dimensions['height'] : $dimensions['width'];
+		} else {
+			// Not a registered WordPress image size. Revert to default.
+			$size = is_numeric( $size ) ? $size : 96;
+		}
+	}
+
 	$defaults = array(
 		// get_avatar_data() args.
-		'size'          => 96,
+		'size'          => $size,
 		'height'        => null,
 		'width'         => null,
 		'default'       => get_option( 'avatar_default', 'mystery' ),
Index: tests/phpunit/tests/avatar.php
===================================================================
--- tests/phpunit/tests/avatar.php	(revision 38337)
+++ tests/phpunit/tests/avatar.php	(working copy)
@@ -229,4 +229,26 @@
 		return $this->fakeURL;
 	}
 
+	/**
+	 * @ticket 37773
+	 */
+	public function test_get_avatar_same_size_by_int_or_string() {
+		$img1 = get_avatar( 1, 150 );
+		$img2 = get_avatar( 1, 'thumbnail' );
+		$this->assertEquals( $img1, $img2 );
+
+		$img3 = get_avatar( 1, 300 );
+		$img4 = get_avatar( 1, 'medium' );
+		$this->assertEquals( $img3, $img4 );
+
+		$img5 = get_avatar( 1, 1024 );
+		$img6 = get_avatar( 1, 'large' );
+		$this->assertEquals( $img5, $img6 );
+	}
+	public function test_get_avatar_default_size_returned_if_string_size_is_not_registered() {
+		$img1 = get_avatar( 1 );
+		$img2 = get_avatar( 1, 'not-a-registered-size' );
+
+		$this->assertEquals( $img1, $img2 );
+	}
 }
