| 1 | Index: post.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- post.php (revision 14085) |
|---|
| 4 | +++ post.php (working copy) |
|---|
| 5 | @@ -683,6 +683,20 @@ |
|---|
| 6 | } |
|---|
| 7 | |
|---|
| 8 | /** |
|---|
| 9 | + * Check if the current or specified post is a post type |
|---|
| 10 | + * |
|---|
| 11 | + * @since 3.0 |
|---|
| 12 | + * @uses get_post_type() |
|---|
| 13 | + * |
|---|
| 14 | + * @param string|array $types Type or types to check. |
|---|
| 15 | + * @param int $id Post ID. Defaults to current ID. |
|---|
| 16 | + * @return bool |
|---|
| 17 | + */ |
|---|
| 18 | +function is_post_type( $types, $id = false ) { |
|---|
| 19 | + return in_array( get_post_type( $id ), (array) $types ); |
|---|
| 20 | +} |
|---|
| 21 | + |
|---|
| 22 | +/** |
|---|
| 23 | * Retrieve the post type of the current post or of a given post. |
|---|
| 24 | * |
|---|
| 25 | * @since 2.1.0 |
|---|