Make WordPress Core

Ticket #39321: 39321.patch

File 39321.patch, 1.1 KB (added by mauteri, 8 years ago)
  • src/wp-includes/link-template.php

     
    162162         */
    163163        $permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename );
    164164
    165         if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) {
     165        if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future', 'inherit' ) ) ) {
    166166                $unixtime = strtotime($post->post_date);
    167167
    168168                $category = '';
     
    200200                }
    201201
    202202                $author = '';
    203                 if ( strpos($permalink, '%author%') !== false ) {
    204                         $authordata = get_userdata($post->post_author);
    205                         $author = $authordata->user_nicename;
     203                if ( false !== strpos( $permalink, '%author%' ) ) {
     204                        $authordata = get_userdata( $post->post_author );
     205                        if ( is_a( $authordata, 'WP_User' ) ) {
     206                                $author = $authordata->user_nicename;
     207                        }
    206208                }
    207209
    208210                $date = explode(" ",date('Y m d H i s', $unixtime));