bp_blogs_update_option_site_icon( int|string $old_value, int|string $new_value )

Syncs site icon URLs to blogmeta.

Description

Parameters

$old_value

(int|string) (Required) Old value

$new_value

(int|string) (Required) New value

Source

File: bp-blogs/bp-blogs-functions.php

function bp_blogs_update_option_site_icon( $old_value, $new_value ) {
	if ( 0 === $new_value ) {
		bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_thumb', 0 );
		bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_full',  0 );
	} else {
		// Save site icon URL as blogmeta.
		bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_thumb', get_site_icon_url( bp_core_avatar_thumb_width() ) );
		bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_full',  get_site_icon_url( bp_core_avatar_full_width()  ) );
	}
}

Changelog

Changelog
Version Description
BuddyPress 2.7.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.