Ticket #12588: remove_default_for_id.diff

File remove_default_for_id.diff, 614 bytes (added by blepoxp, 3 years ago)

Removed lines for id and change default id from null to false so it would work with get_post_type

Line 
1Index: 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