Uma área de pesquisa sobre o WordPress para devs e autores do tema



has_post_thumbnail ›

Desde2.9.0
Obsoleton/a
has_post_thumbnail ( $post = null )
Parâmetros:
  • (int|WP_Post) $post Optional. Post ID or WP_Post object. Default is global `$post`.
    Required: No
    Padrão: null
Retorna:
  • (bool) Whether the post has an image attached.
Definido em:
Codex:
Log de mudanças:
  • 4.4.0

Determines whether a post has an image attached.

For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.



Fonte

function has_post_thumbnail( $post = null ) {
	return (bool) get_post_thumbnail_id( $post );
}