Make WordPress Core

Ticket #64104: fix-64104.patch

File fix-64104.patch, 845 bytes (added by dhruvang21, 10 months ago)
  • src/wp-includes/author-template.php

    diff --git a/src/wp-includes/author-template.php b/src/wp-includes/author-template.php
    index a847fdcc16..0b6cad9a7a 100644
    a b function the_author( $deprecated = '', $deprecated_echo = true ) {  
    8787 *
    8888 * @since 2.8.0
    8989 *
     90 * @param int $post_id Optional. Post ID. Defaults to the current post.
    9091 * @return string|void The author's display name, empty string if unknown.
    9192 */
    92 function get_the_modified_author() {
    93         $last_id = get_post_meta( get_post()->ID, '_edit_last', true );
     93function get_the_modified_author( $post_id = 0 ) {
     94        $post_id = $post_id ? $post_id : get_post()->ID;
     95
     96        if ( ! $post_id ) {
     97                return;
     98        }
     99
     100        $last_id = get_post_meta( $post_id, '_edit_last', true );
    94101
    95102        if ( $last_id ) {
    96103                $last_user = get_userdata( $last_id );