Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/22/2015 02:14:25 PM (10 years ago)
Author:
boonebgorges
Message:

Introduce 'title' argument for bp_get_blog_avatar().

This changeset also changes the default value of the 'title' attribute of blog
avatars to the display name of the site admin. The previous value was the site
admin's email address, which could introduce privacy concerns.

Props lenasterg.
Fixes #6519.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-template.php

    r9959 r9960  
    524524     * admin. Filter 'bp_get_blog_avatar_' . $blog_id to customize.
    525525     *
     526     * @since BuddyPress (2.4.0) Introduced `$title` argument.
     527     *
    526528     * @see bp_core_fetch_avatar() For a description of arguments and
    527529     *      return values.
     
    533535     *     @type string   $alt     Default: 'Profile picture of site author [user name]'.
    534536     *     @type string   $class   Default: 'avatar'.
     537     *     @type string   $title   Default: 'Profile picture of site author [user name]'.
    535538     *     @type string   $type    Default: 'full'.
    536539     *     @type int|bool $width   Default: false.
     
    550553        }
    551554
     555        $author_displayname = bp_core_get_user_displayname( $blogs_template->blog->admin_user_id );
     556
    552557        // Parse the arguments
    553558        $r = bp_parse_args( $args, array(
     
    556561            'height'  => false,
    557562            'class'   => 'avatar',
     563            'title'   => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), esc_attr( $author_displayname ) ),
    558564            'id'      => false,
    559             'alt'     => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), bp_core_get_user_displayname( $blogs_template->blog->admin_user_id ) ),
     565            'alt'     => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), esc_attr( $author_displayname ) ),
    560566            'no_grav' => true,
    561567        ) );
     
    564570        $avatar = bp_core_fetch_avatar( array(
    565571            'item_id'    => $blogs_template->blog->admin_user_id,
    566             'title'      => $blogs_template->blog->admin_user_email,
     572            'title'      => $r['title'],
    567573            //'avatar_dir' => 'blog-avatars',
    568574            //'object'     => 'blog',
Note: See TracChangeset for help on using the changeset viewer.