Ticket #2585: 2585.diff
File 2585.diff, 1.3 KB (added by , 8 years ago) |
---|
-
wp-content/plugins/plugin-directory/api/routes/class-plugin.php
67 67 $result['slug'] = $post->post_name; 68 68 $result['version'] = get_post_meta( $post_id, 'version', true ) ?: '0.0'; 69 69 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'] ); 74 74 } 75 75 76 $result['author_profile'] = $this->get_user_profile_link( $ post->post_author);76 $result['author_profile'] = $this->get_user_profile_link( $result['author'] ); 77 77 $result['contributors'] = array(); 78 78 79 79 if ( $contributors = get_the_terms( $post->ID, 'plugin_contributors' ) ) {