Changeset 14071
- Timestamp:
- 04/11/2010 11:10:54 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r14062 r14071 688 688 * @since 2.1.0 689 689 * 690 * @uses $wpdb 691 * @uses $posts The Loop post global 692 * 693 * @param mixed $post Optional. Post object or post ID. 690 * @uses $post The Loop current post global 691 * 692 * @param mixed $the_post Optional. Post object or post ID. 694 693 * @return bool|string post type or false on failure. 695 694 */ 696 function get_post_type($ post = false) {697 global $post s;698 699 if ( false === $ post )700 $ post = $posts[0];701 elseif ( (int) $post)702 $ post = get_post($post, OBJECT);703 704 if ( is_object($ post) )705 return $ post->post_type;695 function get_post_type($the_post = false) { 696 global $post; 697 698 if ( false === $the_post ) 699 $the_post = $post; 700 elseif ( is_numeric($the_post) ) 701 $the_post = get_post($the_post); 702 703 if ( is_object($the_post) ) 704 return $the_post->post_type; 706 705 707 706 return false;
Note: See TracChangeset
for help on using the changeset viewer.