Skip to:
Content

BuddyPress.org

Ticket #8286: 8286.patch

File 8286.patch, 2.4 KB (added by imath, 5 years ago)
  • src/bp-blogs/bp-blogs-template.php

    diff --git src/bp-blogs/bp-blogs-template.php src/bp-blogs/bp-blogs-template.php
    index fd28f2c36..65e044a42 100644
    function bp_blog_avatar( $args = '' ) { 
    302302         * admin. Filter 'bp_get_blog_avatar_' . $blog_id to customize.
    303303         *
    304304         * @since 2.4.0 Introduced `$title` argument.
    305          * @since 6.0.0 Introduced the `$blog_id` & `$admin_user_id` arguments.
     305         * @since 6.0.0 Introduced the `$blog_id`, `$admin_user_id` and `html` arguments.
    306306         *
    307307         * @see bp_core_fetch_avatar() For a description of arguments and
    308308         *      return values.
    function bp_blog_avatar( $args = '' ) { 
    320320         *     @type bool     $no_grav       Default: false.
    321321         *     @type int      $blog_id       The blog ID. Default: O.
    322322         *     @type int      $admin_user_id The Blog Admin user ID. Default: 0.
     323         *     @type bool     $html          Default: true.
    323324         * }
    324325         * @return string User avatar string.
    325326         */
    function bp_blog_avatar( $args = '' ) { 
    364365                                esc_attr( $author_displayname )
    365366                        ),
    366367                        'no_grav' => false,
     368                        'html'    => true,
    367369                ) );
    368370
    369371                // Use site icon if available.
    function bp_blog_avatar( $args = '' ) { 
    407409
    408410                        // We have a site icon.
    409411                        if ( ! is_numeric( $site_icon ) ) {
     412                                // Just return the raw url of the Site Icon.
     413                                if ( ! $r['html'] ) {
     414                                        return esc_url_raw( $site_icon );
     415                                }
     416
    410417                                if ( empty( $r['width'] ) && ! isset( $size ) ) {
    411418                                        $size = 'full' === $r['type'] ? bp_core_avatar_full_width() : bp_core_avatar_thumb_width();
    412419                                } else {
    function bp_blog_avatar( $args = '' ) { 
    431438                // Fallback to user ID avatar.
    432439                if ( '' === $avatar ) {
    433440                        $avatar = bp_core_fetch_avatar( array(
    434                                 'item_id'    => $admin_user_id,
     441                                'item_id' => $admin_user_id,
    435442                                // 'avatar_dir' => 'blog-avatars',
    436443                                // 'object'     => 'blog',
    437                                 'type'       => $r['type'],
    438                                 'alt'        => $r['alt'],
    439                                 'css_id'     => $r['id'],
    440                                 'class'      => $r['class'],
    441                                 'width'      => $r['width'],
    442                                 'height'     => $r['height'],
    443                                 'no_grav'    => $r['no_grav'],
     444                                'type'    => $r['type'],
     445                                'alt'     => $r['alt'],
     446                                'css_id'  => $r['id'],
     447                                'class'   => $r['class'],
     448                                'width'   => $r['width'],
     449                                'height'  => $r['height'],
     450                                'no_grav' => $r['no_grav'],
     451                                'html'    => $r['html'],
    444452                        ) );
    445453                }
    446454