epl_author_profile_link: change where an agent's name and photo link to
Description #
Changes the address an agent's profile links go to. By default they go to the agent's WordPress author page (get_author_posts_url()).
It is used by the author box (the agent name and the bio's Read More link), the author archive card, the tall author widget and, since 3.6, the Elementor Agent Box, Agent Name and Agent Photo widgets. The Staff Directory add-on uses it to link agents to their staff directory page.
Usage #
add_filter( 'epl_author_profile_link', 'my_author_profile_link', 20, 2 );
Parameters #
$permalink (string)
The link. Default: the agent's author page.
$epl_author (object)
The agent: an EPL_Author_Meta object (an EPL_Author object for the bio's Read More link). Both have author_id, the agent's WordPress user ID.
Examples #
Link each agent to their section of an Our Team page. Priority 20 runs after Staff Directory, which uses priority 10.
function my_author_profile_link( $permalink, $epl_author ) {
return home_url( '/our-team/#agent-' . $epl_author->author_id );
}
add_filter( 'epl_author_profile_link', 'my_author_profile_link', 20, 2 );
Related #
- How to create a custom Author Box template
- epl_author_tab_image: change the agent photo.
Source #
lib/includes/template-functions.php, in epl_author_tab_author_id(); lib/includes/class-epl-author.php, in EPL_Author::get_description_html(); the templates content-author-archive-card.php and widget-content-author-tall.php; and the Elementor agent widgets in lib/page-builders/elementor/widgets/elements/ (since 3.6). Since 2.1.