88/*
99This file is part of Custom Profile Avatar.
1010
11- Plugin Name: Custom Profile Avatar
12- Plugin URI: http://wordpress.org/plugins/
13- Description: Change profile avatar to your custom avatar.
14- Author: en0ndev
15- Version: 1.0
16- Author URI: https://github.com/en0ndev
17-
1811Custom Profile Avatar is free software: you can redistribute it and/or modify
1912it under the terms of the GNU General Public License as published by
2013the Free Software Foundation, either version 3 of the License, or
3326$ usr = new WP_User ;
3427$ current_user = $ usr ->wp_get_current_user ();
3528
36- function get__old ($ id )
29+ function cpa__get__old ($ id )
3730{
3831 $ args = get_avatar_data ($ id );
3932 $ url = $ args ['url ' ];
4033 return $ url ;
4134}
4235
43- function change__avatar ()
36+ function cpa__change__avatar ()
4437{
4538 global $ current_user ;
4639 if (!get_user_meta ($ current_user ->id , 'custom_profile_avatar ' )) {
@@ -50,22 +43,22 @@ function change__avatar()
5043 }
5144}
5245
53- function get__avatar__new ()
46+ function cpa__get__avatar__new ()
5447{
5548 global $ current_user ;
5649 if (empty (get_user_meta ($ current_user ->id , 'custom_profile_avatar ' )[0 ]) || !get_user_meta ($ current_user ->id , 'custom_profile_avatar ' )[0 ]) {
5750 $ out = get_avatar ($ current_user ->id , 110 );
5851 } else {
5952 $ out = '<img class="avatar" src=" ' . get_user_meta ($ current_user ->id , 'custom_profile_avatar ' )[0 ] . '" /><div class="remove"></div> ' ;
6053 }
61- $ out .= '<div id="pull" class="hidden"><img src=" ' . get__old ($ current_user ->id ) . '" /></div> ' ;
54+ $ out .= '<div id="pull" class="hidden"><img src=" ' . cpa__get__old ($ current_user ->id ) . '" /></div> ' ;
6255 return $ out ;
6356}
6457
65- function get__value ()
58+ function cpa__get__value ()
6659{
6760 global $ current_user ;
68- if (get_user_meta ($ current_user ->id , 'custom_profileavatar ' )[0 ])
61+ if (get_user_meta ($ current_user ->id , 'custom_profile_avatar ' )[0 ])
6962 return get_user_meta ($ current_user ->id , 'custom_profile_avatar ' )[0 ];
7063 else
7164 return 0 ;
0 commit comments