Changeset 1250820
- Timestamp:
- 09/22/2015 02:41:50 AM (10 years ago)
- Location:
- profile-picture
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
profile-picture/tags/1.0/class/class_pp.php
r1249951 r1250820 10 10 11 11 # Register shortcodes 12 add_filter( 'the_content', 'do_shortcode'); 12 add_filter( 'the_content', 'do_shortcode'); 13 add_filter( 'get_avatar', array($this, 'pp_avatar'), 1, 5 ); 13 14 $this->setup_actions(); 14 15 } … … 64 65 } 65 66 67 // Overwrite Default avator 68 public function pp_avatar( $avatar, $id_or_email, $size, $default, $alt ) { 69 $user = false; 70 71 if ( is_numeric( $id_or_email ) ) { 72 73 $id = (int) $id_or_email; 74 $user = get_user_by( 'id' , $id ); 75 76 } elseif ( is_object( $id_or_email ) ) { 77 78 if ( ! empty( $id_or_email->user_id ) ) { 79 $id = (int) $id_or_email->user_id; 80 $user = get_user_by( 'id' , $id ); 81 } 82 83 } else { 84 $user = get_user_by( 'email', $id_or_email ); 85 } 86 87 if ( $user && is_object( $user ) ) { 88 $upload_dir = wp_upload_dir(); 89 $pp_url = get_user_meta($user->ID, 'pp_url', true); 90 $custom_avatar = $upload_dir['baseurl'].$pp_url; 91 92 if (isset($custom_avatar) && !empty($custom_avatar)) { 93 $avatar = "<img alt='{$alt}' src='{$custom_avatar}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; 94 } 95 96 } 97 98 return $avatar; 99 } 66 100 67 101 } -
profile-picture/tags/1.0/readme.txt
r1249951 r1250820 1 1 === Plugin Name === 2 Contributors: arul 2 Contributors: aruljayarajs 3 3 Tags: user profile, custom profile photo, profile picture, custom profile picture, profile photo 4 4 Requires at least: 3.0 -
profile-picture/trunk/class/class_pp.php
r1249951 r1250820 10 10 11 11 # Register shortcodes 12 add_filter( 'the_content', 'do_shortcode'); 12 add_filter( 'the_content', 'do_shortcode'); 13 add_filter( 'get_avatar', array($this, 'pp_avatar'), 1, 5 ); 13 14 $this->setup_actions(); 14 15 } … … 63 64 include_once(PP_PLUGIN_HTML_DIR."/profile_fields.php"); 64 65 } 66 67 // Overwrite Default avator 68 public function pp_avatar( $avatar, $id_or_email, $size, $default, $alt ) { 69 $user = false; 70 71 if ( is_numeric( $id_or_email ) ) { 72 73 $id = (int) $id_or_email; 74 $user = get_user_by( 'id' , $id ); 75 76 } elseif ( is_object( $id_or_email ) ) { 77 78 if ( ! empty( $id_or_email->user_id ) ) { 79 $id = (int) $id_or_email->user_id; 80 $user = get_user_by( 'id' , $id ); 81 } 82 83 } else { 84 $user = get_user_by( 'email', $id_or_email ); 85 } 86 87 if ( $user && is_object( $user ) ) { 88 $upload_dir = wp_upload_dir(); 89 $pp_url = get_user_meta($user->ID, 'pp_url', true); 90 $custom_avatar = $upload_dir['baseurl'].$pp_url; 91 92 if (isset($custom_avatar) && !empty($custom_avatar)) { 93 $avatar = "<img alt='{$alt}' src='{$custom_avatar}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; 94 } 95 96 } 97 98 return $avatar; 99 } 65 100 66 101 -
profile-picture/trunk/readme.txt
r1249951 r1250820 1 1 === Plugin Name === 2 Contributors: arul 2 Contributors: aruljayarajs 3 3 Tags: user profile, custom profile photo, profile picture, custom profile picture, profile photo 4 4 Requires at least: 3.0
Note: See TracChangeset
for help on using the changeset viewer.