ap_user_link_anchor( string $user_id, boolean $echo = true )

Description #

User name and link with anchor tag.

Parameters #

  • $user_id
    string (Required) User ID.
  • $echo
    boolean (Optional) Echo or return. Default value: true

Source #

File: includes/functions.php

function ap_user_link_anchor( $user_id, $echo = true ) {

	$name = ap_user_display_name( $user_id );

	if ( $user_id < 1 ) {
		if ( $echo ) {
			echo $name; // xss okay.
		} else {
			return $name;
		}
	}

	$html  = '<a href="' . ap_user_link( $user_id ) . '">';
	$html .= $name;
	$html .= '</a>';

	if ( $echo ) {
		echo $html; // xss okay.
	}

	return $html;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment