Retrieve Post Thumbnail.

Signature

get_the_post_thumbnail( $post_id = null, $size = 'post-thumbnail', $attr = '' )
post_id
 (int) Optional. Post ID.
Default: null
size
 (string) Optional. Image size. Defaults to 'post-thumbnail'.
Default: 'post-thumbnail'
attr
 (string|array) Optional. Query string or array of attributes.
Default: ''

Return

(void)

Source

function get_the_post_thumbnail( $post_id = null, $size = 'post-thumbnail', $attr = '' ) {
	$post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
	$post_thumbnail_id = get_post_thumbnail_id( $post_id );

	/**
	 * Filter the post thumbnail size.
	 *
	 * @since 2.9.0
	 *
	 * @param string $size The post thumbnail size.
	 */
	$size = apply_filters( 'post_thumbnail_size', $size );

	if ( $post_thumbnail_id ) {

		/**
		 * Fires before fetching the post thumbnail HTML.
		 *
		 * Provides "just in time" filtering of all filters in wp_get_attachment_image().
		 *
38 more lines...
WP Trac GitHub

Link here