Changeset 14498
- Timestamp:
- 05/07/2010 04:57:23 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r14487 r14498 682 682 683 683 /** 684 * Checks if a post type is registered , can also check if the current or specified post is of a post type.684 * Checks if a post type is registered. Can also check if the current or specified post is of a post type. 685 685 * 686 686 * @since 3.0.0 … … 692 692 */ 693 693 function is_post_type( $types = false, $id = false ) { 694 $types = ( $types === false ) ? get_post_types() : (array) $types; 695 return in_array( get_post_type( $id ), $types ); 694 if ( $id ) { 695 $types = ( $types === false ) ? get_post_types() : (array) $types; 696 697 return in_array( get_post_type( $id ), $types ); 698 } 699 700 return (bool) get_post_type_object($types); 696 701 } 697 702
Note: See TracChangeset
for help on using the changeset viewer.