wp-includes/post-formats.php:49Check if a post has any of the given formats, or any format.
$formatstring|string[]optionalarray()$postWP_Post|int|nulloptionalnullboolfunction has_post_format( $format = array(), $post = null ) { $prefixed = array(); if ( $format ) { foreach ( (array) $format as $single ) { $prefixed[] = 'post-format-' . sanitize_key( $single ); } } return has_term( $prefixed, 'post_format', $post );}Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/post-formats.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.