Function Reference/set post thumbnail
Description
Sets a post thumbnail.
Usage
<?php set_post_thumbnail( $post, $thumbnail_id ); ?>
Parameters
- $post
- (int) (Post ID or object where thumbnail should be attached.) object
- Default: required
- $thumbnail_id
- (integer) (required) Thumbnail to attach.
- Default: None
Return Values
- (boolean)
- True on success, false on failure.
Change Log
Source File
set_post_thumbnail() is located in wp-includes/post.php.
Related