Changeset 7213 for branches/2.6/src/includes/users/template.php
- Timestamp:
- 10/12/2021 10:05:17 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/src/includes/users/template.php
r7186 r7213 445 445 } 446 446 447 $user = get_userdata( $user_id ); 448 $user_link = '<a href="' . esc_url( bbp_get_user_profile_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 449 450 // Filter & return 451 return apply_filters( 'bbp_get_user_profile_link', $user_link, $user_id ); 447 // Get the user 448 $user = get_userdata( $user_id ); 449 if ( empty( $user ) ) { 450 return false; 451 } 452 453 // Display Name 454 $name = ! empty( $user->display_name ) 455 ? $user->display_name 456 : bbp_get_fallback_display_name(); 457 458 // URL 459 $url = bbp_get_user_profile_url( $user_id ); 460 461 // Link 462 $link = ! empty( $url ) 463 ? '<a href="' . esc_url( $url ) . '">' . esc_html( $name ) . '</a>' 464 : esc_html( $name ); 465 466 // Filter & return 467 return (string) apply_filters( 'bbp_get_user_profile_link', $link, $user_id ); 452 468 } 453 469 … … 597 613 } 598 614 599 $user = get_userdata( $user_id ); 600 $edit_link = '<a href="' . esc_url( bbp_get_user_profile_edit_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 601 602 // Filter & return 603 return apply_filters( 'bbp_get_user_profile_edit_link', $edit_link, $user_id ); 615 // Get the user 616 $user = get_userdata( $user_id ); 617 if ( empty( $user ) ) { 618 return false; 619 } 620 621 // Display Name 622 $name = ! empty( $user->display_name ) 623 ? $user->display_name 624 : bbp_get_fallback_display_name(); 625 626 // URL 627 $url = bbp_get_user_profile_edit_url( $user_id ); 628 629 // Link 630 $link = ! empty( $url ) 631 ? '<a href="' . esc_url( $url ) . '">' . esc_html( $name ) . '</a>' 632 : esc_html( $name ); 633 634 // Filter & return 635 return (string) apply_filters( 'bbp_get_user_profile_edit_link', $link, $user_id ); 604 636 } 605 637
Note: See TracChangeset
for help on using the changeset viewer.