WordPress.org

Making WordPress.org

Ticket #2585: 2585.diff

File 2585.diff, 1.3 KB (added by obenland, 3 years ago)
  • wp-content/plugins/plugin-directory/api/routes/class-plugin.php

     
    6767                $result['slug'] = $post->post_name;
    6868                $result['version'] = get_post_meta( $post_id, 'version', true ) ?: '0.0';
    6969
    70                 $author = get_user_by( 'id', $post->post_author );
    71                 $result['author'] = $author->display_name;
    72                 if ( $author->user_url ) {
    73                         $result['author'] = sprintf( '<a href="%s">%s</a>', $author->user_url, $result['author'] );
     70                $author_url = get_post_meta( $post_id, 'header_author_uri', true );
     71                $result['author'] = strip_tags( get_post_meta( $post_id, 'header_author', true ) ) ?: get_user_by( 'id', $post->post_author )->display_name;
     72                if ( $author_url ) {
     73                        $result['author'] = sprintf( '<a href="%s">%s</a>', $author_url, $result['author'] );
    7474                }
    7575
    76                 $result['author_profile'] = $this->get_user_profile_link( $post->post_author );
     76                $result['author_profile'] = $this->get_user_profile_link( $result['author'] );
    7777                $result['contributors'] = array();
    7878
    7979                if ( $contributors = get_the_terms( $post->ID, 'plugin_contributors' ) ) {