Ticket #4333: 4333.02.diff
File 4333.02.diff, 4.6 KB (added by , 12 years ago) |
---|
-
bp-members/bp-members-template.php
764 764 765 765 /** Avatars *******************************************************************/ 766 766 767 /** 768 * Output logged in user avatar. 769 * 770 * @since BuddyPress (1.1) 771 * 772 * @param array $args Avatar args {@link bp_core_fetch_avatar()} 773 * 774 * @uses bp_get_loggedin_user_avatar() 775 */ 767 776 function bp_loggedin_user_avatar( $args = '' ) { 768 777 echo bp_get_loggedin_user_avatar( $args ); 769 778 } 779 /** 780 * Return logged in user avatar. 781 * 782 * @since BuddyPress (1.1) 783 * 784 * @param array $args Avatar args {@link bp_core_fetch_avatar()} 785 * 786 * @global object $bp BuddyPress global settings 787 * @uses bp_loggedin_user_id() 788 * @uses bp_get_loggedin_user_email() 789 * @uses apply_filters() to call 'bp_get_loggedin_user_avatar' hook 790 * 791 * @return string Logged in user avatar 792 */ 770 793 function bp_get_loggedin_user_avatar( $args = '' ) { 771 794 795 // Setup default args 772 796 $defaults = array( 773 'type' => 'thumb',774 'width' => false,775 'height' => false,776 'html' => true,777 797 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_loggedin_user_fullname() ) 778 798 ); 779 799 780 800 $r = wp_parse_args( $args, $defaults ); 781 extract( $r, EXTR_SKIP );782 801 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 ) ) ); 802 // Set logged in user args 803 $r = ['item_id'] = bp_loggedin_user_id(); 804 $r = ['email'] = bp_get_loggedin_user_email(); 805 806 return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( $r ) ); 784 807 } 785 808 809 /** 810 * Output displayed user avatar. 811 * 812 * @since BuddyPress (1.1) 813 * 814 * @param array $args Avatar args {@link bp_core_fetch_avatar()} 815 * 816 * @uses bp_get_displayed_user_avatar() 817 */ 786 818 function bp_displayed_user_avatar( $args = '' ) { 787 819 echo bp_get_displayed_user_avatar( $args ); 788 820 } 821 /** 822 * Return displayed user avatar. 823 * 824 * @since BuddyPress (1.1) 825 * 826 * @param array $args Avatar args {@link bp_core_fetch_avatar()} 827 * 828 * @global object $bp BuddyPress global settings 829 * @uses bp_displayed_user_id() 830 * @uses bp_get_displayed_user_email() 831 * @uses apply_filters() to call 'bp_get_displayed_user_avatar' hook 832 * 833 * @return string Displayed in user avatar 834 */ 789 835 function bp_get_displayed_user_avatar( $args = '' ) { 790 836 837 // Setup default args 791 838 $defaults = array( 792 'type' => 'thumb',793 'width' => false,794 'height' => false,795 'html' => true,796 839 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 797 840 ); 798 841 799 842 $r = wp_parse_args( $args, $defaults ); 800 extract( $r, EXTR_SKIP );801 843 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 ) ) ); 844 // Set displayed user args 845 $r = ['item_id'] = bp_displayed_user_id(); 846 $r = ['email'] = bp_get_displayed_user_email(); 847 848 return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( $r ) ); 803 849 } 804 850 851 /** 852 * Output logged in user email. 853 * 854 * @since BuddyPress (1.6) 855 * 856 * @uses bp_get_loggedin_user_email() 857 */ 858 function bp_loggedin_user_email() { 859 echo bp_get_loggedin_user_email(); 860 } 861 /** 862 * Return logged in user email. 863 * 864 * @since BuddyPress (1.6) 865 * 866 * @global object $bp BuddyPress global settings 867 * @uses bp_get_loggedin_user_email() 868 * @uses apply_filters() to call 'bp_get_loggedin_user_email' hook 869 * 870 * @return string Logged in user email 871 */ 872 function bp_get_loggedin_user_email() { 873 global $bp; 874 875 // Setup default 876 $retval = ''; 877 878 // If displayed user exists, return email address 879 if ( isset( $bp->loggedin_user->userdata->user_email ) ) 880 $retval = $bp->loggedin_user->userdata->user_email; 881 882 return apply_filters( 'bp_get_loggedin_user_email', esc_attr( $retval ) ); 883 } 884 885 /** 886 * Output displayed in user email. 887 * 888 * @since BuddyPress (1.5) 889 * 890 * @uses bp_get_displayed_user_email 891 */ 805 892 function bp_displayed_user_email() { 806 893 echo bp_get_displayed_user_email(); 807 894 } 895 /** 896 * Return displayed in user email. 897 * 898 * @since BuddyPress (1.5) 899 * 900 * @global object $bp BuddyPress global settings 901 * @uses bp_get_displayed_user_email() 902 * @uses apply_filters() to call 'bp_get_displayed_user_email' hook 903 * 904 * @return string Displayed user email 905 */ 808 906 function bp_get_displayed_user_email() { 809 907 global $bp; 810 908