Languages:
English •
日本語
(Add your language)
Description
Sets a post thumbnail.
Usage
<?php set_post_thumbnail( $post, $thumbnail_id ); ?>
Parameters
- $post
- (int/object) (required) Post ID or object where thumbnail should be attached.
- Default: None
- $thumbnail_id
- (integer) (required) Thumbnail to attach.
- Default: None
Return Values
- (int/bool)
- Post meta ID on success, false on failure.
Change Log
Source File
set_post_thumbnail() is located in wp-includes/post.php
.
Related
delete_post_thumbnail()