Ticket #2436: add_url_parameter.diff
File add_url_parameter.diff, 3.8 KB (added by , 15 years ago) |
---|
-
bp-core/bp-core-templatetags.php
601 601 $defaults = array( 602 602 'type' => 'thumb', 603 603 'width' => false, 604 'height' => false 604 'height' => false, 605 'url' => false 605 606 ); 606 607 607 608 $r = wp_parse_args( $args, $defaults ); 608 609 extract( $r, EXTR_SKIP ); 609 610 610 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 ) ) );611 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, 'url' => $url ) ) ); 611 612 } 612 613 613 614 function bp_displayed_user_avatar( $args = '' ) { … … 619 620 $defaults = array( 620 621 'type' => 'thumb', 621 622 'width' => false, 622 'height' => false 623 'height' => false, 624 'url' => false 623 625 ); 624 626 625 627 $r = wp_parse_args( $args, $defaults ); 626 628 extract( $r, EXTR_SKIP ); 627 629 628 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 ) ) );630 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, 'url' => $url ) ) ); 629 631 } 630 632 631 633 function bp_avatar_admin_step() { -
bp-core/bp-core-avatars.php
60 60 'css_id' => false, 61 61 'alt' => __( 'Avatar Image', 'buddypress' ), 62 62 'email' => false, // Pass the user email (for gravatar) to prevent querying the DB for it 63 'no_grav' => false // If there is no avatar found, return false instead of a grav? 63 'no_grav' => false, // If there is no avatar found, return false instead of a grav? 64 'url' => false // Do we output the image or just the url 64 65 ); 65 66 66 67 $params = wp_parse_args( $args, $defaults ); … … 129 130 } 130 131 closedir($av_dir); 131 132 132 if ( $avatar_url ) 133 if ( $avatar_url && $url ) 134 return apply_filters( 'bp_core_fetch_avatar', $avatar_url, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 135 elseif ( $avatar_url ) 133 136 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$avatar_url}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} />", $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 134 137 } 135 138 … … 162 165 $email = apply_filters( 'bp_core_gravatar_email', $email, $item_id, $object ); 163 166 $gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( $email ) . '?d=' . $default_grav . '&s=' . $grav_size; 164 167 165 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} />", $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 168 if ( $url ) 169 return apply_filters( 'bp_core_fetch_avatar', $gravatar, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 170 else 171 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} />", $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 166 172 } else { 167 173 return apply_filters( 'bp_core_fetch_avatar', false, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 168 174 }