| 782 | /** |
| 783 | * Return logged in user avatar. |
| 784 | * |
| 785 | * @since BuddyPress (1.1) |
| 786 | * |
| 787 | * @param array $args Avatar args {@link bp_core_fetch_avatar()} |
| 788 | * Passing the 'item_id' or 'email' args will have no effect |
| 789 | * as they will be overwritten by bp_loggedin_user_id() |
| 790 | * and bp_get_loggedin_user_email(), respectively. |
| 791 | * |
| 792 | * @global object $bp BuddyPress global settings |
| 793 | * @uses bp_loggedin_user_id() |
| 794 | * @uses bp_get_loggedin_user_email() |
| 795 | * @uses apply_filters() to call 'bp_get_loggedin_user_avatar' hook |
| 796 | * |
| 797 | * @return string Logged in user avatar |
| 798 | */ |
783 | | return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_loggedin_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) ); |
| 808 | // Set logged in user args |
| 809 | $r['item_id'] = bp_loggedin_user_id(); |
| 810 | $r['email'] = bp_get_loggedin_user_email(); |
| 811 | |
| 812 | return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( $r ) ); |
| 830 | /** |
| 831 | * Return displayed user avatar. |
| 832 | * |
| 833 | * @since BuddyPress (1.1) |
| 834 | * |
| 835 | * @param array $args Avatar args {@link bp_core_fetch_avatar()} |
| 836 | * Passing the 'item_id' or 'email' args will have no effect |
| 837 | * as they will be overwritten by bp_displayed_user_id() |
| 838 | * and bp_get_displayed_user_email(), respectively. |
| 839 | * |
| 840 | * @global object $bp BuddyPress global settings |
| 841 | * @uses bp_displayed_user_id() |
| 842 | * @uses bp_get_displayed_user_email() |
| 843 | * @uses apply_filters() to call 'bp_get_displayed_user_avatar' hook |
| 844 | * |
| 845 | * @return string Displayed in user avatar |
| 846 | */ |
802 | | return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_displayed_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) ); |
| 856 | // Set displayed user args |
| 857 | $r['item_id'] = bp_displayed_user_id(); |
| 858 | $r['email'] = bp_get_displayed_user_email(); |
| 859 | |
| 860 | return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( $r ) ); |
| 863 | /** |
| 864 | * Output logged in user email. |
| 865 | * |
| 866 | * @since BuddyPress (1.6) |
| 867 | * |
| 868 | * @uses bp_get_loggedin_user_email() |
| 869 | */ |
| 870 | function bp_loggedin_user_email() { |
| 871 | echo bp_get_loggedin_user_email(); |
| 872 | } |
| 873 | /** |
| 874 | * Return logged in user email. |
| 875 | * |
| 876 | * @since BuddyPress (1.6) |
| 877 | * |
| 878 | * @global object $bp BuddyPress global settings |
| 879 | * @uses bp_get_loggedin_user_email() |
| 880 | * @uses apply_filters() to call 'bp_get_loggedin_user_email' hook |
| 881 | * |
| 882 | * @return string Logged in user email |
| 883 | */ |
| 884 | function bp_get_loggedin_user_email() { |
| 885 | global $bp; |
| 886 | |
| 887 | // Setup default |
| 888 | $retval = ''; |
| 889 | |
| 890 | // If displayed user exists, return email address |
| 891 | if ( isset( $bp->loggedin_user->userdata->user_email ) ) |
| 892 | $retval = $bp->loggedin_user->userdata->user_email; |
| 893 | |
| 894 | return apply_filters( 'bp_get_loggedin_user_email', esc_attr( $retval ) ); |
| 895 | } |
| 896 | |
| 897 | /** |
| 898 | * Output displayed in user email. |
| 899 | * |
| 900 | * @since BuddyPress (1.5) |
| 901 | * |
| 902 | * @uses bp_get_displayed_user_email |
| 903 | */ |