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 ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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