WordPress at Your Fingertips
function is not described

_wp_preview_post_thumbnail_filter() WP 4.6.0

Filters post thumbnail lookup to set the post thumbnail.

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.

Return

null|Array. The default return value or the post thumbnail meta array.

Usage

_wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key );
$value(null|array|string) (required)
The value to return - a single metadata value, or an array of values.
$post_id(int) (required)
Post ID.
$meta_key(string) (required)
Meta key.

Changelog

Since 4.6.0 Introduced.

Code of _wp_preview_post_thumbnail_filter() WP 5.8.2

function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) {
	$post = get_post();
	if ( ! $post ) {
		return $value;
	}

	if ( empty( $_REQUEST['_thumbnail_id'] ) ||
		empty( $_REQUEST['preview_id'] ) ||
		$post->ID != $post_id ||
		'_thumbnail_id' !== $meta_key ||
		'revision' === $post->post_type ||
		$post_id != $_REQUEST['preview_id'] ) {

		return $value;
	}

	$thumbnail_id = (int) $_REQUEST['_thumbnail_id'];
	if ( $thumbnail_id <= 0 ) {
		return '';
	}

	return (string) $thumbnail_id;
}