<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][10287] trunk/src/bp-core/bp-core-avatars.php: Avatars: Support new parameters from WordPress 4.2.0 when filtering `'get_avatar'`.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/10287">10287</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/10287","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>r-a-y</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-10-19 20:09:00 +0000 (Mon, 19 Oct 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Avatars: Support new parameters from WordPress 4.2.0 when filtering `'get_avatar'`.
WordPress 4.2.0 added a new parameter - `$args` - to their `'get_avatar'`
filter. This `$args` parameter is an array that houses additional options
including the width, height and CSS class, as well as the following
parameters:
- `'extra_attr'` - unsanitized HTML attributes to add to the `<img>` element.
- `'scheme'` - URL scheme to use.
- `'rating'` - Gravatar rating.
- `'force_default'` - Only applicable to Gravatars. Always use the default image even if a valid Gravatar exists.
Consequently, `bp_core_fetch_avatar()` now supports the listed options
above as well.
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/6622">#6622</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpcorebpcoreavatarsphp">trunk/src/bp-core/bp-core-avatars.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpcorebpcoreavatarsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-avatars.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-avatars.php 2015-10-19 19:47:01 UTC (rev 10286)
+++ trunk/src/bp-core/bp-core-avatars.php 2015-10-19 20:09:00 UTC (rev 10287)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,6 +103,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * locally:
</span><span class="cx" style="display: block; padding: 0 10px"> * add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 2.4.0 Added 'extra_attr', 'scheme', 'rating' and 'force_default' for $args.
+ * These are inherited from WordPress 4.2.0. See {@link get_avatar()}.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * An array of arguments. All arguments are technically optional; some
</span><span class="cx" style="display: block; padding: 0 10px"> * will, if not provided, be auto-detected by bp_core_fetch_avatar(). This
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,6 +175,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type bool $html Whether to return an <img> HTML element, vs a raw URL
</span><span class="cx" style="display: block; padding: 0 10px"> * to an avatar. If false, <img>-specific arguments (like 'css_id')
</span><span class="cx" style="display: block; padding: 0 10px"> * will be ignored. Default: true.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type string $extra_attr HTML attributes to insert in the IMG element. Not sanitized. Default: ''.
+ * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values.
+ * Default null.
+ * @type string $rating What rating to display Gravatars for. Accepts 'G', 'PG', 'R', 'X'.
+ * Default is the value of the 'avatar_rating' option.
+ * @type bool $force_default Used when creating the Gravatar URL. Whether to force the default
+ * image regardless if the Gravatar exists. Default: false.
</ins><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,19 +198,23 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set the default variables array and parse it against incoming $args array.
</span><span class="cx" style="display: block; padding: 0 10px"> $params = wp_parse_args( $args, array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'item_id' => false,
- 'object' => 'user',
- 'type' => 'thumb',
- 'avatar_dir' => false,
- 'width' => false,
- 'height' => false,
- 'class' => 'avatar',
- 'css_id' => false,
- 'alt' => '',
- 'email' => false,
- 'no_grav' => false,
- 'html' => true,
- 'title' => '',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'item_id' => false,
+ 'object' => 'user',
+ 'type' => 'thumb',
+ 'avatar_dir' => false,
+ 'width' => false,
+ 'height' => false,
+ 'class' => 'avatar',
+ 'css_id' => false,
+ 'alt' => '',
+ 'email' => false,
+ 'no_grav' => false,
+ 'html' => true,
+ 'title' => '',
+ 'extra_attr' => '',
+ 'scheme' => null,
+ 'rating' => get_option( 'avatar_rating' ),
+ 'force_default' => false,
</ins><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** Set item_id ***********************************************************/
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -346,6 +360,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $html_title = ' title="' . esc_attr( $params['title'] ) . '"';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Extra attributes
+ $extra_attr = ! empty( $args['extra_attr'] ) ? ' ' . $args['extra_attr'] : '';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Set CSS ID and create html string.
</span><span class="cx" style="display: block; padding: 0 10px"> $html_css_id = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -505,6 +522,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If we found a locally uploaded avatar
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $avatar_url ) ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Support custom scheme
+ $avatar_url = set_url_scheme( $avatar_url, $params['scheme'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Return it wrapped in an <img> element
</span><span class="cx" style="display: block; padding: 0 10px"> if ( true === $params['html'] ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -524,7 +543,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $avatar_folder_url Avatar URL path.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $avatar_folder_dir Avatar dir path.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '"' . $html_class . $html_css_id . $html_width . $html_height . $html_alt . $html_title . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '"' . $html_class . $html_css_id . $html_width . $html_height . $html_alt . $html_title . $extra_attr . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // ...or only the URL
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -579,8 +598,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $host = '//www.gravatar.com/avatar/';
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the Gravatar email to use.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -593,20 +610,37 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $params['email'] = apply_filters( 'bp_core_gravatar_email', $params['email'], $params['item_id'], $params['object'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Filters the Gravatar URL path.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Filters the Gravatar URL host.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0.2
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $value Gravatar URL path.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $value Gravatar URL host.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( strtolower( $params['email'] ) ) . '?d=' . $default_grav . '&s=' . $params['width'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $gravatar = apply_filters( 'bp_gravatar_url', '//www.gravatar.com/avatar/' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Gravatar rating; http://bit.ly/89QxZA
- $rating = get_option( 'avatar_rating' );
- if ( ! empty( $rating ) ) {
- $gravatar .= "&r={$rating}";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Append email hash to Gravatar
+ $gravatar .= md5( strtolower( $params['email'] ) );
+
+ // Main Gravatar URL args
+ $url_args = array(
+ 'd' => $default_grav,
+ 's' => $params['width']
+ );
+
+ // Custom Gravatar URL args
+ if ( ! empty( $params['force_default'] ) ) {
+ $url_args['f'] = 'y';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $params['rating'] ) ) {
+ $url_args['r'] = strtolower( $params['rating'] );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Set up the Gravatar URL
+ $gravatar = esc_url( add_query_arg(
+ rawurlencode_deep( array_filter( $url_args ) ),
+ $gravatar
+ ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // No avatar was found, and we've been told not to use a gravatar.
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -626,7 +660,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( true === $params['html'] ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in bp-core/bp-core-avatars.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '"' . $html_css_id . $html_class . $html_width . $html_height . $html_alt . $html_title . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '"' . $html_css_id . $html_class . $html_width . $html_height . $html_alt . $html_title . $extra_attr . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in bp-core/bp-core-avatars.php */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1281,17 +1315,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Replace default WordPress avatars with BP avatars, if available.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Filters 'get_avatar'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * See 'get_avatar' filter description in wp-includes/pluggable.php.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 2.4.0 Added $args parameter to coincide with WordPress 4.2.0.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $avatar The avatar path passed to 'get_avatar'.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|string|object $user A user ID, email address, or comment object.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $size Size of the avatar image ('thumb' or 'full').
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $default URL to a default image to use if no avatar is available.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $alt Alternate text to use in image tag. Default: ''.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $args Arguments passed to get_avatar_data(), after processing.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string BP avatar path, if found; else the original avatar path.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '', $args = array() ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $pagenow;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Do not filter if inside WordPress options page
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1332,19 +1369,47 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $type = 'full';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Let BuddyPress handle the fetching of the avatar
- $bp_avatar = bp_core_fetch_avatar( array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $avatar_args = array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'item_id' => $id,
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => $type,
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => $size,
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => $size,
</span><span class="cx" style="display: block; padding: 0 10px"> 'alt' => $alt,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Support new arguments as of WordPress 4.2.0
+ if ( ! empty( $args['width'] ) ) {
+ $avatar_args['width'] = $args['width'];
+ }
+ if ( ! empty( $args['height'] ) ) {
+ $avatar_args['height'] = $args['height'];
+ }
+ if ( ! empty( $args['class'] ) ) {
+ $avatar_args['class'] = $args['class'];
+ }
+ if ( ! empty( $args['class'] ) ) {
+ $avatar_args['class'] = $args['class'];
+ }
+ if ( ! empty( $args['extra_attr'] ) ) {
+ $avatar_args['extra_attr'] = $args['extra_attr'];
+ }
+ if ( ! empty( $args['scheme'] ) ) {
+ $avatar_args['scheme'] = $args['scheme'];
+ }
+ if ( ! empty( $args['force_default'] ) ) {
+ $avatar_args['force_default'] = $args['force_default'];
+ }
+ if ( ! empty( $args['rating'] ) ) {
+ $avatar_args['rating'] = $args['rating'];
+ }
+
+ // Let BuddyPress handle the fetching of the avatar
+ $bp_avatar = bp_core_fetch_avatar( $avatar_args );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // If BuddyPress found an avatar, use it. If not, use the result of get_avatar
</span><span class="cx" style="display: block; padding: 0 10px"> return ( !$bp_avatar ) ? $avatar : $bp_avatar;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_filter( 'get_avatar', 'bp_core_fetch_avatar_filter', 10, 5 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_filter( 'get_avatar', 'bp_core_fetch_avatar_filter', 10, 6 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Is the current avatar upload error-free?
</span></span></pre>
</div>
</div>
</body>
</html>