Reputation::display_name( string $name, array $args )
Description #
Append user reputations in display name.
Parameters #
- $namestring (Required) User display name.
- $argsarray (Required) Arguments.
Source #
File: addons/reputation/reputation.php
public function display_name( $name, $args ) { if ( $args['user_id'] > 0 ) { if ( $args['html'] ) { $reputation = ap_get_user_reputation_meta( $args['user_id'] ); if ( ap_is_addon_active( 'buddypress.php' ) && function_exists( 'bp_core_get_userlink' ) ) { return $name . '<a href="' . ap_user_link( $args['user_id'] ) . 'reputations/" class="ap-user-reputation" title="' . __( 'Reputation', 'anspress-question-answer' ) . '">' . $reputation . '</a>'; } else { // phpcs:ignore Universal.ControlStructures.DisallowLonelyIf.Found if ( ap_is_addon_active( 'profile.php' ) ) { return $name . '<a href="' . ap_user_link( $args['user_id'] ) . 'reputations/" class="ap-user-reputation" title="' . __( 'Reputation', 'anspress-question-answer' ) . '">' . $reputation . '</a>'; } else { return $name . '<span class="ap-user-reputation" title="' . __( 'Reputation', 'anspress-question-answer' ) . '">' . $reputation . '</span>'; } } } } return $name; }
Expand full source code Collapse full source code View on GitHub: addons/reputation/reputation.php:443
Add your comment