jetpack_get_site_logo

Retrieve the site logo URL or ID (URL by default).

Description

jetpack_get_site_logo( (string) $show = 'url' ); 

Pass in the string id for ID.

Parameters (1)

0. $show — Optional. (string) => 'url'
The show.

Usage

  1. if ( !function_exists( 'jetpack_get_site_logo' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/theme-tools/site-logo/inc/functions.php'; 
  3.  
  4. // The show. 
  5. $show = 'url'; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = jetpack_get_site_logo($show); 
  9.  

Defined (1)

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

/modules/theme-tools/site-logo/inc/functions.php  
  1. function jetpack_get_site_logo( $show = 'url' ) { 
  2. $logo =site_logo)->logo; 
  3.  
  4. // Return false if no logo is set 
  5. if ( ! isset( $logo['id'] ) || 0 == $logo['id'] ) { 
  6. return false; 
  7.  
  8. // Return the ID if specified, otherwise return the URL by default 
  9. if ( 'id' == $show ) { 
  10. return $logo['id']; 
  11. } else { 
  12. return esc_url_raw( set_url_scheme( $logo['url'] ) );