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

Syncs site icon URLs to blogmeta.


Parameters Parameters

$old_value

(int|string) (Required) Old value

$new_value

(int|string) (Required) New value


Source Source

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

function bp_blogs_update_option_site_icon( $old_value, $new_value ) {
	$blog_id = get_current_blog_id();

	if ( 0 === $new_value ) {
		bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_thumb', 0 );
		bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_full',  0 );
	} else {
		// Save site icon URL as blogmeta.
		bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_thumb', bp_blogs_get_site_icon_url( $blog_id, bp_core_avatar_thumb_width() ) );
		bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_full',  bp_blogs_get_site_icon_url( $blog_id, bp_core_avatar_full_width()  ) );
	}
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.