| | 5193 | * Removes a post thumbnail. |
| | 5194 | * |
| | 5195 | * @param int|object $post Post ID or object where thumbnail should be removed from. |
| | 5196 | * @return bool True on success, false on failure. |
| | 5197 | */ |
| | 5198 | function delete_post_thumbnail( $post ) { |
| | 5199 | $post = get_post( $post ); |
| | 5200 | if ( $post ) { |
| | 5201 | $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); |
| | 5202 | if ( ! empty( $thumbnail_id ) ) { |
| | 5203 | delete_post_meta( $post->ID, '_thumbnail_id' ); |
| | 5204 | return true; |
| | 5205 | } |
| | 5206 | return true; |
| | 5207 | } |
| | 5208 | return false; |
| | 5209 | } |
| | 5210 | |
| | 5211 | /** |