[wp-trac] [WordPress Trac] #39844: Don't return anchor tag if link is empty in get_the_author_posts_link()
WordPress Trac
noreply at wordpress.org
Sat Feb 11 11:17:29 UTC 2017
#39844: Don't return anchor tag if link is empty in get_the_author_posts_link()
----------------------------+-----------------------------
Reporter: SirkoSchindler | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 4.7.2
Severity: normal | Keywords:
Focuses: template |
----------------------------+-----------------------------
If get_author_posts_url() returns an empty value, currently
get_the_author_posts_link() creates an anchor tag with am empty target. If
shown on the page this results in a link to the current page, which is not
what is expected from an author link.
https://core.trac.wordpress.org/browser/tags/4.7.2/src/wp-includes/author-
template.php#L252
The attached patch changes this, so that if no link is given, just the
author name is returned with no anchor tag surrounding.
This is in line with the respective code for get_comment_author_link()
https://core.trac.wordpress.org/browser/tags/4.7.2/src/wp-includes
/comment-template.php#L216
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39844>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list