<!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][12496] trunk: Make it possible to fetch a blog's avatar outside of the blogs loop</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 { white-space: pre-line; 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/12496">12496</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/12496","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-11-11 12:48:27 +0000 (Mon, 11 Nov 2019)</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'>Make it possible to fetch a blog's avatar outside of the blogs loop

Passing 2 new parameters (`$blog_id` & `$admin_user_id`) to the `bp_get_blog_avatar()` function will return the corresponding blog's avatar without the need to run a blogs loop.

Props espellcaste

Fixes <a href="http://buddypress.trac.wordpress.org/ticket/8150">#8150</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpblogsbpblogstemplatephp">trunk/src/bp-blogs/bp-blogs-template.php</a></li>
<li><a href="#trunktestsphpunittestcasesblogstemplatephp">trunk/tests/phpunit/testcases/blogs/template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpblogsbpblogstemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-blogs/bp-blogs-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-blogs/bp-blogs-template.php  2019-11-07 19:00:08 UTC (rev 12495)
+++ trunk/src/bp-blogs/bp-blogs-template.php    2019-11-11 12:48:27 UTC (rev 12496)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -301,6 +301,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * admin. Filter 'bp_get_blog_avatar_' . $blog_id to customize.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 2.4.0 Introduced `$title` argument.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * @since 6.0.0 Introduced the `$blog_id` & `$admin_user_id` arguments.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @see bp_core_fetch_avatar() For a description of arguments and
</span><span class="cx" style="display: block; padding: 0 10px">         *      return values.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -309,13 +310,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *     Arguments are listed here with an explanation of their defaults.
</span><span class="cx" style="display: block; padding: 0 10px">         *     For more information about the arguments, see
</span><span class="cx" style="display: block; padding: 0 10px">         *     {@link bp_core_fetch_avatar()}.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         *     @type string   $alt     Default: 'Profile picture of site author [user name]'.
-        *     @type string   $class   Default: 'avatar'.
-        *     @type string   $type    Default: 'full'.
-        *     @type int|bool $width   Default: false.
-        *     @type int|bool $height  Default: false.
-        *     @type bool     $id      Currently unused.
-        *     @type bool     $no_grav Default: true.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  *     @type string   $alt           Default: 'Profile picture of site author [user name]'.
+        *     @type string   $class         Default: 'avatar'.
+        *     @type string   $type          Default: 'full'.
+        *     @type int|bool $width         Default: false.
+        *     @type int|bool $height        Default: false.
+        *     @type bool     $id            Currently unused.
+        *     @type bool     $no_grav       Default: false.
+        *     @type int      $blog_id       The blog ID. Default: O.
+        *     @type int      $admin_user_id The Blog Admin user ID. Default: 0.
</ins><span class="cx" style="display: block; padding: 0 10px">          * }
</span><span class="cx" style="display: block; padding: 0 10px">         * @return string User avatar string.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -328,8 +331,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return false;
</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">-                $author_displayname = bp_core_get_user_displayname( $blogs_template->blog->admin_user_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         // Set default values.
+               $author_displayname = '';
+               $admin_user_id      = 0;
+               $blog_id            = 0;
</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 ( ! $blogs_template && isset( $args['admin_user_id'] ) && $args['admin_user_id'] ) {
+                       $admin_user_id      = (int) $args['admin_user_id'];
+                       $author_displayname = bp_core_get_user_displayname( $admin_user_id );
+               } else {
+                       $admin_user_id      = $blogs_template->blog->admin_user_id;
+                       $author_displayname = bp_core_get_user_displayname( $blogs_template->blog->admin_user_id );
+               }
+
+               if ( ! $blogs_template && isset( $args['blog_id'] ) && $args['blog_id'] ) {
+                       $blog_id = (int) $args['blog_id'];
+               } else {
+                       $blog_id = bp_get_blog_id();
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 // Parse the arguments.
</span><span class="cx" style="display: block; padding: 0 10px">                $r = bp_parse_args( $args, array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'type'    => 'full',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -338,17 +358,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'class'   => 'avatar',
</span><span class="cx" style="display: block; padding: 0 10px">                        'id'      => false,
</span><span class="cx" style="display: block; padding: 0 10px">                        'alt'     => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), esc_attr( $author_displayname ) ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'no_grav' => true,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'no_grav' => 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">                // Use site icon if available.
</span><span class="cx" style="display: block; padding: 0 10px">                $avatar = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( bp_is_active( 'blogs', 'site-icon' ) && function_exists( 'has_site_icon' ) ) {
-                       $site_icon = bp_blogs_get_blogmeta( bp_get_blog_id(), "site_icon_url_{$r['type']}" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( bp_is_active( 'blogs', 'site-icon' ) ) {
+                       $site_icon = bp_blogs_get_blogmeta( $blog_id, "site_icon_url_{$r['type']}" );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // Never attempted to fetch site icon before; do it now!
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( '' === $site_icon ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                switch_to_blog( bp_get_blog_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         switch_to_blog( $blog_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                // Fetch the other size first.
</span><span class="cx" style="display: block; padding: 0 10px">                                if ( 'full' === $r['type'] ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -366,7 +386,7 @@
</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">                                // Sync site icon for other size to blogmeta.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                bp_blogs_update_blogmeta( bp_get_blog_id(), "site_icon_url_{$save_size}", $site_icon );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         bp_blogs_update_blogmeta( $blog_id, "site_icon_url_{$save_size}", $site_icon );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                // Now, fetch the size we want.
</span><span class="cx" style="display: block; padding: 0 10px">                                if ( 0 !== $site_icon ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -375,7 +395,7 @@
</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">                                // Sync site icon to blogmeta.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                bp_blogs_update_blogmeta( bp_get_blog_id(), "site_icon_url_{$r['type']}", $site_icon );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         bp_blogs_update_blogmeta( $blog_id, "site_icon_url_{$r['type']}", $site_icon );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -388,11 +408,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        $size = (int) $r['width'];
</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">+                                $alt_attribute = __( 'Site icon for the blog', 'buddypress' );
+                               if ( $blogs_template ) {
+                                       /* translators: %s is the placeholder for the name of the blog */
+                                       $alt_attribute = sprintf( __( 'Site icon for %s', 'buddypress' ), bp_get_blog_name() );
+                               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $avatar = sprintf( '<img src="%1$s" class="%2$s" width="%3$s" height="%3$s" alt="%4$s" />',
</span><span class="cx" style="display: block; padding: 0 10px">                                        esc_url( $site_icon ),
</span><span class="cx" style="display: block; padding: 0 10px">                                        esc_attr( "{$r['class']} avatar-{$size}" ),
</span><span class="cx" style="display: block; padding: 0 10px">                                        esc_attr( $size ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        sprintf( esc_attr__( 'Site icon for %s', 'buddypress' ), bp_get_blog_name() )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 esc_attr( $alt_attribute )
</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">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -400,7 +426,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                // Fallback to user ID avatar.
</span><span class="cx" style="display: block; padding: 0 10px">                if ( '' === $avatar ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $avatar = bp_core_fetch_avatar( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                'item_id'    => $blogs_template->blog->admin_user_id,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         'item_id'    => $admin_user_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                                 // 'avatar_dir' => 'blog-avatars',
</span><span class="cx" style="display: block; padding: 0 10px">                                // 'object'     => 'blog',
</span><span class="cx" style="display: block; padding: 0 10px">                                'type'       => $r['type'],
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,7 +434,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'css_id'     => $r['id'],
</span><span class="cx" style="display: block; padding: 0 10px">                                'class'      => $r['class'],
</span><span class="cx" style="display: block; padding: 0 10px">                                'width'      => $r['width'],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                'height'     => $r['height']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         'height'     => $r['height'],
+                               'no_grav'    => $r['no_grav'],
</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"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -420,7 +447,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * This filter is deprecated as of BuddyPress 1.5 and may be removed in a future version.
</span><span class="cx" style="display: block; padding: 0 10px">                 * Use the 'bp_get_blog_avatar' filter instead.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $avatar = apply_filters( 'bp_get_blog_avatar_' . $blogs_template->blog->blog_id, $avatar );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $avatar = apply_filters( 'bp_get_blog_avatar_' . $blog_id, $avatar );
</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">                 * Filters a blog's avatar.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -432,7 +459,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param int    $blog_id ID of the blog whose avatar is being displayed.
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param array  $r       Array of arguments used when fetching 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">-                return apply_filters( 'bp_get_blog_avatar', $avatar, $blogs_template->blog->blog_id, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return apply_filters( 'bp_get_blog_avatar', $avatar, $blog_id, $r );
</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"> function bp_blog_permalink() {
</span></span></pre></div>
<a id="trunktestsphpunittestcasesblogstemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/testcases/blogs/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/testcases/blogs/template.php  2019-11-07 19:00:08 UTC (rev 12495)
+++ trunk/tests/phpunit/testcases/blogs/template.php    2019-11-11 12:48:27 UTC (rev 12496)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,4 +367,92 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $_REQUEST = $request;
</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">+        /**
+        * @group avatar
+        * @group BP_Blogs_Template
+        * @group bp_get_blog_avatar
+        */
+       public function test_bp_get_blog_avatar_ids_provided() {
+               if ( ! is_multisite() ) {
+                       $this->markTestSkipped();
+               }
+
+               if ( function_exists( 'wp_initialize_site' ) ) {
+                       $this->setExpectedDeprecated( 'wpmu_new_blog' );
+               }
+
+               global $blogs_template;
+               $reset_blogs_template = $blogs_template;
+               $blogs_template = null;
+
+               $u = self::factory()->user->create();
+               $b = self::factory()->blog->create( array(
+                       'title' => 'The Foo Bar Blog',
+                       'user_id' => $u,
+               ) );
+
+               $avatar = bp_get_blog_avatar( array(
+                       'type'          => 'full',
+                       'admin_user_id' => $u,
+                       'blog_id'       => $b,
+                       'alt'           => 'test',
+                       'no_grav'       => true,
+                       'class'         => 'avatar',
+               ) );
+
+               $blogs_template = $reset_blogs_template;
+
+               $this->assertTrue( $avatar === bp_core_fetch_avatar( array(
+                       'type'          => 'full',
+                       'item_id'       => $u,
+                       'alt'           => 'test',
+                       'no_grav'       => true,
+                       'class'         => 'avatar',
+               ) ) );
+       }
+
+       /**
+        * @group avatar
+        * @group BP_Blogs_Template
+        * @group bp_get_blog_avatar
+        */
+       public function test_bp_get_blog_avatar_has_site_icon() {
+               if ( ! is_multisite() ) {
+                       $this->markTestSkipped();
+               }
+
+               if ( function_exists( 'wp_initialize_site' ) ) {
+                       $this->setExpectedDeprecated( 'wpmu_new_blog' );
+               }
+
+               global $blogs_template;
+               $reset_blogs_template = $blogs_template;
+               $blogs_template = null;
+
+               $u = self::factory()->user->create();
+               $b = self::factory()->blog->create( array(
+                       'title' => 'The Bar Foo Blog',
+                       'user_id' => $u,
+               ) );
+
+               add_filter( 'get_site_icon_url', array( $this, 'filter_blog_avatar' ) );
+
+               $avatar = bp_get_blog_avatar( array(
+                       'type'          => 'full',
+                       'admin_user_id' => $u,
+                       'blog_id'       => $b,
+                       'alt'           => 'test',
+                       'no_grav'       => true,
+                       'class'         => 'avatar',
+               ) );
+
+               remove_filter( 'get_site_icon_url', array( $this, 'filter_blog_avatar' ) );
+               $blogs_template = $reset_blogs_template;
+
+               $this->assertTrue( false !== strpos( $avatar, BP_TESTS_DIR . 'assets/upside-down.jpg' ) );
+       }
+
+       public function filter_blog_avatar() {
+               return BP_TESTS_DIR . 'assets/upside-down.jpg';
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>

</body>
</html>