Ticket #19012: post-template.diff
File post-template.diff, 993 bytes (added by , 12 years ago) |
---|
-
wp-includes/post-template.php
11 11 /** 12 12 * Display the ID of the current item in the WordPress Loop. 13 13 * 14 * If the optional $id param is passed then this will simply display the $id. 15 * 14 16 * @since 0.71 17 * 18 * @param int $id Optional. Post ID. 15 19 */ 16 function the_ID( ) {17 echo get_the_ID( );20 function the_ID( $id = 0 ) { 21 echo get_the_ID( $id ); 18 22 } 19 23 20 24 /** 21 25 * Retrieve the ID of the current item in the WordPress Loop. 22 26 * 27 * If the optional $id param is passed then this will simply return the $id. 28 * 23 29 * @since 2.1.0 24 30 * @uses $post 25 31 * 32 * @param int $id Optional. Post ID. 26 33 * @return int 27 34 */ 28 function get_the_ID() { 29 global $post; 30 return $post->ID; 35 function get_the_ID( $id = 0 ) { 36 if ( (int) $id > 0 ) { 37 return $id; 38 } else { 39 global $post; 40 return $post->ID; 41 } 31 42 } 32 43 33 44 /**