Changeset 35867 for trunk/src/wp-includes/post-template.php
- Timestamp:
- 12/11/2015 04:38:15 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r35737 r35867 170 170 * @since 1.5.0 171 171 * 172 * @param int|WP_Post $id Optional. Post ID or post object. 173 */ 174 function the_guid( $id = 0 ) { 172 * @param int|WP_Post $post Optional. Post ID or post object. Default is global $post. 173 */ 174 function the_guid( $post = 0 ) { 175 $post = get_post( $post ); 176 177 $guid = isset( $post->guid ) ? get_the_guid( $post ) : ''; 178 $id = isset( $post->ID ) ? $post->ID : 0; 179 175 180 /** 176 181 * Filter the escaped Global Unique Identifier (guid) of the post. … … 180 185 * @see get_the_guid() 181 186 * 182 * @param string $post_guid Escaped Global Unique Identifier (guid) of the post. 187 * @param string $guid Escaped Global Unique Identifier (guid) of the post. 188 * @param int $id The post ID. 183 189 */ 184 echo apply_filters( 'the_guid', get_the_guid( $id ));190 echo apply_filters( 'the_guid', $guid, $id ); 185 191 } 186 192 … … 194 200 * @since 1.5.0 195 201 * 196 * @param int|WP_Post $ id Optional. Post ID or post object.202 * @param int|WP_Post $post Optional. Post ID or post object. Default is global $post. 197 203 * @return string 198 204 */ 199 function get_the_guid( $id = 0 ) { 200 $post = get_post($id); 205 function get_the_guid( $post = 0 ) { 206 $post = get_post( $post ); 207 208 $guid = isset( $post->guid ) ? $post->guid : ''; 209 $id = isset( $post->ID ) ? $post->ID : 0; 201 210 202 211 /** … … 205 214 * @since 1.5.0 206 215 * 207 * @param string $post_guid Global Unique Identifier (guid) of the post. 216 * @param string $guid Global Unique Identifier (guid) of the post. 217 * @param int $id The post ID. 208 218 */ 209 return apply_filters( 'get_the_guid', $ post->guid );219 return apply_filters( 'get_the_guid', $guid, $id ); 210 220 } 211 221
Note: See TracChangeset
for help on using the changeset viewer.