jetpack-get_site_icon

Filters the display options for the Site Icon.

Description

apply_filters( 'jetpack-get_site_icon', (string) $avatar, (int) $blog_id, (string) $size, (string) $default, (string) $alt ); 

Parameters (5)

0. $avatar (string)
The Site Icon in an html image tag.
1. $blog_id (int)
The local site Blog ID.
2. $size (string)
The size of the Site Icon, default is 512.
3. $default (string)
The default URL for the Site Icon.
4. $alt (string)
The alt tag for the avatar.

Usage

To run the hook, copy the example below.
  1. $avatar = apply_filters( 'jetpack-get_site_icon', $avatar, $blog_id, $size, $default, $alt ); 
  2.  
  3. if ( !empty( $avatar ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the jetpack-get_site_icon callback 
  2. function filter_jetpack_get_site_icon( $avatar, $blog_id, $size, $default, $alt ) { 
  3. // make filter magic happen here... 
  4. return $avatar
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'jetpack-get_site_icon', 'filter_jetpack_get_site_icon', 10, 5 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'jetpack-get_site_icon', 'filter_jetpack_get_site_icon', 10, 5 ); 

Defined (1)

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

/modules/site-icon/site-icon-functions.php  
  1. return apply_filters( 'jetpack-get_site_icon', $avatar, $blog_id, $size, $default, $alt );