Function Reference/set post format
Languages:
English •
(Add your language)
Description
Set the post format of a post. This can be called and used anywhere if a post Object and the format is provided.
Usage
<?php set_post_format( $post , $format); ?>
Parameters
- $post
- (int or object) (Required) ID of the post or Object of the post.
- Default: none
- $format
- (string or array) (Required) The format of the post. Use an empty string or array to remove all formats from the post.
- Default: none
Returns
- Array (array)
- Array of affected term IDs. or mixed WP_Error if no or wrong post id or post object is passed.
Changelog
Source File
set_post_format() is located in wp-includes/post.php.
Related
Post Formats:
set_post_format(),
get_post_format(),
has_post_format()