Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




has_post_format [ WordPress Function ]

has_post_format ( $format, $post = null )
Parameters:
  • (string) $format The format to check for
  • (object|id) $post The post to check. If not supplied, defaults to the current post if used in the loop.
Uses:
Returns:
  • (bool) True if the post has the format, false otherwise.
Defined at:



Check if a post has a particular format

Source


<?php
function has_post_format$format$post null ) {
    return 
has_term('post-format-' sanitize_key($format), 'post_format'$post);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics