ap_user_link_anchor( string $user_id, boolean $output = true )
Description #
User name and link with anchor tag.
Parameters #
- $user_idstring (Required) User ID.
- $outputboolean (Optional) Echo or return. Default value: true
Source #
File: includes/functions.php
function ap_user_link_anchor( $user_id, $output = true ) {
$name = ap_user_display_name( $user_id );
if ( $user_id < 1 ) {
if ( $output ) {
echo $name; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
return $name;
}
}
$html = '<a href="' . esc_url( ap_user_link( $user_id ) ) . '">';
$html .= $name;
$html .= '</a>';
if ( $output ) {
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
return $html;
}
Expand full source code Collapse full source code View on GitHub: includes/functions.php:1534
Add your comment