Changeset 5305 for trunk/bp-members/bp-members-functions.php
- Timestamp:
- 11/08/2011 02:15:22 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-functions.php
r5302 r5305 494 494 * @return bool True if spammer, False if not. 495 495 */ 496 function bp_ core_is_user_spammer( $user_id = 0 ) {496 function bp_is_user_spammer( $user_id = 0 ) { 497 497 global $wpdb; 498 498 … … 522 522 } 523 523 524 return apply_filters( 'bp_ core_is_user_spammer', (bool) $is_spammer );524 return apply_filters( 'bp_is_user_spammer', (bool) $is_spammer ); 525 525 } 526 526 … … 532 532 * @return bool True if deleted, False if not. 533 533 */ 534 function bp_ core_is_user_deleted( $user_id = 0 ) {534 function bp_is_user_deleted( $user_id = 0 ) { 535 535 global $wpdb; 536 536 … … 561 561 } 562 562 563 return apply_filters( 'bp_core_is_user_deleted', (bool) $is_deleted ); 563 return apply_filters( 'bp_is_user_deleted', (bool) $is_deleted ); 564 } 565 566 /** 567 * Checks if user is active 568 * 569 * @since BuddyPress (1.6) 570 * 571 * @uses is_user_logged_in() To check if user is logged in 572 * @uses bbp_get_displayed_user_id() To get current user ID 573 * @uses bbp_is_user_spammer() To check if user is spammer 574 * @uses bbp_is_user_deleted() To check if user is deleted 575 * 576 * @param int $user_id The user ID to check 577 * @return bool True if public, false if not 578 */ 579 function bp_is_user_active( $user_id = 0 ) { 580 581 // Default to current user 582 if ( empty( $user_id ) && is_user_logged_in() ) 583 $user_id = bp_loggedin_user_id(); 584 585 // No user to check 586 if ( empty( $user_id ) ) 587 return false; 588 589 // Check spam 590 if ( bp_is_user_spammer( $user_id ) ) 591 return false; 592 593 // Check deleted 594 if ( bp_is_user_deleted( $user_id ) ) 595 return false; 596 597 // Assume true if not spam or deleted 598 return true; 599 } 600 601 /** 602 * Checks if user is not active. 603 * 604 * @since BuddyPress (1.6) 605 * 606 * @uses is_user_logged_in() To check if user is logged in 607 * @uses bp_get_displayed_user_id() To get current user ID 608 * @uses bp_is_user_active() To check if user is active 609 * 610 * @param int $user_id The user ID to check 611 * @return bool True if inactive, false if active 612 */ 613 function bp_is_user_inactive( $user_id = 0 ) { 614 615 // Default to current user 616 if ( empty( $user_id ) && is_user_logged_in() ) 617 $user_id = bp_loggedin_user_id(); 618 619 // No user to check 620 if ( empty( $user_id ) ) 621 return false; 622 623 // Return the inverse of active 624 return !bp_is_user_active( $user_id ); 564 625 } 565 626
Note: See TracChangeset
for help on using the changeset viewer.