bp_blogs_update_option_site_icon

Syncs site icon URLs to blogmeta.

Description

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

Parameters (2)

0. $old_value (int|string)
The old value.
1. $new_value (int|string)
The new value.

Usage

  1. if ( !function_exists( 'bp_blogs_update_option_site_icon' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-functions.php'; 
  3.  
  4. // The old value. 
  5. $old_value = null; 
  6.  
  7. // The new value. 
  8. $new_value = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_blogs_update_option_site_icon($old_value, $new_value); 
  12.  

Defined (1)

The function is defined in the following location(s).

/bp-blogs/bp-blogs-functions.php  
  1. function bp_blogs_update_option_site_icon( $old_value, $new_value ) { 
  2. if ( 0 === $new_value ) { 
  3. bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_thumb', 0 ); 
  4. bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_full', 0 ); 
  5. } else { 
  6. // Save site icon URL as blogmeta. 
  7. bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_thumb', get_site_icon_url( bp_core_avatar_thumb_width() ) ); 
  8. bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_full', get_site_icon_url( bp_core_avatar_full_width() ) );