Ticket #34480: 34480.diff
File 34480.diff, 1.5 KB (added by , 10 years ago) |
---|
-
src/wp-includes/post-template.php
236 236 * Retrieve the post content. 237 237 * 238 238 * @since 0.71 239 * @since 4.5.0 Added the `$id` parameter. 239 240 * 240 241 * @global int $page 241 242 * @global int $more … … 245 246 * 246 247 * @param string $more_link_text Optional. Content for when there is more text. 247 248 * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false. 249 * @param int|WP_Post $id Optional. Post ID or post object. 248 250 * @return string 249 251 */ 250 function get_the_content( $more_link_text = null, $strip_teaser = false ) {252 function get_the_content( $more_link_text = null, $strip_teaser = false, $id = null ) { 251 253 global $page, $more, $preview, $pages, $multipage; 252 254 253 $post = get_post( );255 $post = get_post( $id ); 254 256 255 257 if ( null === $more_link_text ) 256 258 $more_link_text = __( '(more…)' ); … … 347 349 * Retrieve the post excerpt. 348 350 * 349 351 * @since 0.71 352 * @since 4.5.0 Added the `$id` parameter. 350 353 * 351 354 * @param mixed $deprecated Not used. 355 * @param int|WP_Post $id Optional. Post ID or post object. 352 356 * @return string 353 357 */ 354 function get_the_excerpt( $deprecated = '' ) {358 function get_the_excerpt( $deprecated = '', $id = null ) { 355 359 if ( !empty( $deprecated ) ) 356 360 _deprecated_argument( __FUNCTION__, '2.3' ); 357 361 358 $post = get_post( );362 $post = get_post( $id ); 359 363 if ( empty( $post ) ) { 360 364 return ''; 361 365 }