Changeset 6438 for trunk/src/includes/users/functions.php
- Timestamp:
- 05/27/2017 05:04:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/users/functions.php
r6422 r6438 40 40 } 41 41 42 // Filter & return 42 43 return apply_filters( 'bbp_redirect_login', $url, $raw_url, $user ); 43 44 } … … 55 56 */ 56 57 function bbp_is_anonymous() { 57 if ( ! is_user_logged_in() && bbp_allow_anonymous() ) { 58 $is_anonymous = true; 59 } else { 60 $is_anonymous = false; 61 } 62 63 return apply_filters( 'bbp_is_anonymous', $is_anonymous ); 58 $is_anonymous = ( ! is_user_logged_in() && bbp_allow_anonymous() ); 59 60 // Filter & return 61 return (bool) apply_filters( 'bbp_is_anonymous', $is_anonymous ); 64 62 } 65 63 … … 167 165 $retval = preg_replace( '/[^0-9a-fA-F:., ]/', '', $remote_address ); 168 166 167 // Filter & return 169 168 return apply_filters( 'bbp_current_author_ip', $retval, $remote_address ); 170 169 } … … 182 181 : ''; 183 182 183 // Filter & return 184 184 return apply_filters( 'bbp_current_author_ua', $retval ); 185 185 } … … 553 553 ) ); 554 554 555 // Filter & return 555 556 return apply_filters( 'bbp_get_user_topics_started', $query, $user_id ); 556 557 } … … 581 582 ) ); 582 583 584 // Filter & return 583 585 return apply_filters( 'bbp_get_user_replies_created', $query, $user_id ); 584 586 } … … 595 597 function bbp_get_total_users() { 596 598 $user_count = count_users(); 597 return apply_filters( 'bbp_get_total_users', (int) $user_count['total_users'] ); 599 600 // Filter & return 601 return (int) apply_filters( 'bbp_get_total_users', (int) $user_count['total_users'] ); 598 602 } 599 603 … … 632 636 } 633 637 634 return apply_filters( 'bbp_get_user_ids_from_nicenames', $retval, $user_nicenames ); 638 // Filter & return 639 return (array) apply_filters( 'bbp_get_user_ids_from_nicenames', $retval, $user_nicenames ); 635 640 } 636 641 … … 664 669 } 665 670 666 return apply_filters( 'bbp_get_user_nicenames_from_ids', $retval, $user_ids ); 671 // Filter & return 672 return (array) apply_filters( 'bbp_get_user_nicenames_from_ids', $retval, $user_ids ); 667 673 } 668 674 … … 693 699 $count = $count + bbp_get_user_closed_topic_count( $user_id ); 694 700 701 // Filter & return 695 702 return (int) apply_filters( 'bbp_get_user_topic_count_raw', $count, $user_id ); 696 703 } … … 718 725 $count = count_user_posts( $user_id, bbp_get_reply_post_type(), false ); 719 726 727 // Filter & return 720 728 return (int) apply_filters( 'bbp_get_user_reply_count_raw', $count, $user_id ); 721 729 } … … 748 756 ) ); 749 757 758 // Filter & return 750 759 return (int) apply_filters( 'bbp_get_user_closed_topic_count', $count, $user_id ); 751 760 }
Note: See TracChangeset
for help on using the changeset viewer.