post_thumbnail_meta_box() WordPress Function

The post_thumbnail_meta_box() function allows you to add a meta box to the post editor screen for setting the post thumbnail. This feature is available in WordPress 3.0 and above.

post_thumbnail_meta_box( WP_Post $post ) #

Displays post thumbnail meta box.


Parameters

$post

(WP_Post)(Required)Current post object.


Top ↑

Source

File: wp-admin/includes/meta-boxes.php

function post_thumbnail_meta_box( $post ) {
	$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
	echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
}


Top ↑

Changelog

Changelog
VersionDescription
2.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.