Quantcast
Viewing latest article 8
Browse Latest Browse All 9

Meet the new default avatar for Sites

The BuddyPress Members and Groups were the only components to have a default avatar so far. The Site Tracking component felt very strongly about it, protesting it was about time to give it a default “blavatar” (blog avatar) Image may be NSFW.
Clik here to view.
😁
. It’s finally happening in BuddyPress 7.0.0 Image may be NSFW.
Clik here to view.
🙌
.

The default site avatar

Image may be NSFW.
Clik here to view.
The default blavatar !

Multisite WordPress configurations will be able to find it when displaying the Sites directory. It appears when sites of the loop doesn’t have a WordPress Site Icon set. Here’s how this directory will look like once BuddyPress 7.0.0 will be released.

Using a Site Icon as the Site’s avatar

The Site Icon / Site Avatar synchronization of the Site Tracking component was introduced in BuddyPress 2.7.0, but here’s a reminder about how to set a Site Icon for a site of your network.

Image may be NSFW.
Clik here to view.
The Site Icon Customizer’s panel

The primary use of the WordPress Site Icon feature is to generate icons for your site so that, for example, it displays into your browser’s tab (favicon). You can set it using the Cutomizer from the corresponding site of the network. In our example the WordPress site. Once the Customizer is loaded, head over to the Site Identity panel and you’ll find the place to set the Site Icon at the bottom of it (Image may be NSFW.
Clik here to view.
⚠
don’t confuse with the Site Logo). Click on the “Select Site Icon” button (or the “Change image” button if you already have a Site Icon in place) to upload your image and crop it to match WordPress needs. Once you’ll publish your changes, BuddyPress will automagically use this image to set the Site’s avatar and use it everywhere the Site Tracking component is displaying your site (into the Sites directory and into the “Sites” tab of the Member’s front-end profile page for the users attached to this site).

Keeping the Site’s admin avatar as the default Site’s avatar

If you prefer to keep on displaying the Site’s admin avatar as the default site avatar after BuddyPress 7.0.0 is released, you can always do so using the following piece of code into your bp-custom.php file for example.

/**
 * Filter to carry on using site admin avatar.
 *
 * @param array $args The Blog Avatar arguments.
 * @return array      The Blog Avatar arguments.
 */
function carry_on_using_site_admin_avatar( $args ) {
	global $blogs_template;

	if ( isset( $blogs_template->blog->admin_user_id ) ) {
		$args['admin_user_id'] = (int) $blogs_template->blog->admin_user_id;
		$args['alt']           = sprintf(
			/* translators: %s: the author display name */
			__( 'Profile picture of site author %s', 'buddypress' ),
			esc_attr( bp_core_get_user_displayname( $args['admin_user_id'] ) )
		);
	}

	return $args;
}
add_filter( 'bp_before_blog_avatar_parse_args', 'carry_on_using_site_admin_avatar', 10, 1 );

If you’d like to know the story of this change, you can get more information reading the #8179 ticket.

The new default site avatar will be available into the BuddyPress 7.0.0-beta2 release we plan to publish next Wednesday, we strongly encourage you to test it as well as all the 7.0.0 new features Image may be NSFW.
Clik here to view.
🙏
.

#7-0-0, #8179, #site-tracking


Viewing latest article 8
Browse Latest Browse All 9

Trending Articles