Make WordPress Core

Ticket #34480: 34480.diff

File 34480.diff, 1.5 KB (added by MikeHansenMe, 10 years ago)
  • src/wp-includes/post-template.php

     
    236236 * Retrieve the post content.
    237237 *
    238238 * @since 0.71
     239 * @since 4.5.0 Added the `$id` parameter.
    239240 *
    240241 * @global int   $page
    241242 * @global int   $more
     
    245246 *
    246247 * @param string $more_link_text Optional. Content for when there is more text.
    247248 * @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.
    248250 * @return string
    249251 */
    250 function get_the_content( $more_link_text = null, $strip_teaser = false ) {
     252function get_the_content( $more_link_text = null, $strip_teaser = false, $id = null ) {
    251253        global $page, $more, $preview, $pages, $multipage;
    252254
    253         $post = get_post();
     255        $post = get_post( $id );
    254256
    255257        if ( null === $more_link_text )
    256258                $more_link_text = __( '(more…)' );
     
    347349 * Retrieve the post excerpt.
    348350 *
    349351 * @since 0.71
     352 * @since 4.5.0 Added the `$id` parameter.
    350353 *
    351354 * @param mixed $deprecated Not used.
     355 * @param int|WP_Post $id Optional. Post ID or post object.
    352356 * @return string
    353357 */
    354 function get_the_excerpt( $deprecated = '' ) {
     358function get_the_excerpt( $deprecated = '', $id = null ) {
    355359        if ( !empty( $deprecated ) )
    356360                _deprecated_argument( __FUNCTION__, '2.3' );
    357361
    358         $post = get_post();
     362        $post = get_post( $id );
    359363        if ( empty( $post ) ) {
    360364                return '';
    361365        }