Changeset 21735 for trunk/wp-includes/post.php
- Timestamp:
- 09/04/2012 04:29:28 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r21655 r21735 373 373 * @link http://codex.wordpress.org/Function_Reference/get_post 374 374 * 375 * @param int|object $post Post ID or post object. 375 * @param int|object $post Post ID or post object. Optional, default is the current post from the loop. 376 376 * @param string $output Optional, default is Object. Either OBJECT, ARRAY_A, or ARRAY_N. 377 377 * @param string $filter Optional, default is raw. 378 378 * @return WP_Post|null WP_Post on success or null on failure 379 379 */ 380 function get_post( $post , $output = OBJECT, $filter = 'raw' ) {380 function get_post( $post = null, $output = OBJECT, $filter = 'raw' ) { 381 381 if ( empty( $post ) && isset( $GLOBALS['post'] ) ) 382 382 $post = $GLOBALS['post']; … … 946 946 * @uses $post The Loop current post global 947 947 * 948 * @param mixed $ the_post Optional. Post object or post ID.948 * @param mixed $post Optional. Post object or post ID. 949 949 * @return bool|string post type or false on failure. 950 950 */ 951 function get_post_type( $the_post = false ) { 952 global $post; 953 954 if ( false === $the_post ) 955 $the_post = $post; 956 elseif ( is_numeric($the_post) ) 957 $the_post = get_post($the_post); 958 959 if ( is_object($the_post) ) 960 return $the_post->post_type; 951 function get_post_type( $post = null ) { 952 if ( $post = get_post( $post ) ) 953 return $post->post_type; 961 954 962 955 return false;
Note: See TracChangeset
for help on using the changeset viewer.