Changeset 15778
- Timestamp:
- 10/12/2010 07:25:58 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r15777 r15778 490 490 491 491 return ( str_replace('post-format-', '', $format[0]) ); 492 } 493 494 /** 495 * Check if a post has a particular format 496 * 497 * @since 3.1 498 * 499 * @uses has_term() 500 * 501 * @param string $format The format to check for 502 * @param object|id $post The post to check. If not supplied, defaults to the current post if used in the loop. 503 * @return bool True if the post has the format, false otherwise. 504 */ 505 function has_post_format( $format, $post = null ) { 506 return has_term('post-format-' . sanitize_key($format), 'post_format', $post); 492 507 } 493 508
Note: See TracChangeset
for help on using the changeset viewer.