WordPress.org

Make WordPress Core

Opened 8 months ago

Last modified 8 months ago

#51859 new enhancement

Add filter to get_the_author_link

Reported by: dshanske Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

In order to allow customization of the markup, including adding classes for styling, and changing the rel properties, suggest the introduction of a get_the_author_link filter to allow this to be edited.

Change History (1)

This ticket was mentioned in PR #772 on WordPress/wordpress-develop by donmhico.


8 months ago

  • Keywords has-patch added

Apply filter to author's HTML link using author_html_link filter.

Example usage

{{{php
/

  • @param string $html_link The default HTML author link.
  • @param string $author_url The author's url.
  • @param string $display_name The author's display name. */

add_filter( 'author_html_link', function( $html_link, $author_url, $display_name ) {

return '<a href="https://wp.org">Mico</a>';

}, 10, 3 );
}}}

Trac ticket: https://core.trac.wordpress.org/ticket/51859

Note: See TracTickets for help on using tickets.