jetpack_get_site_logo_dimensions

Retrieve an array of the dimensions of the Site Logo.

Description

(array) jetpack_get_site_logo_dimensions(); 

Returns (array)

$dimensions { An array of dimensions of the Site Logo. @type string $width Width of the logo in pixels. @type string $height Height of the logo in pixels. }


Usage

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

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_dimensions() { 
  2. // Get the image size to use with the logo. 
  3. $size =site_logo)->theme_size(); 
  4.  
  5. // If the size is the default `thumbnail`, get its dimensions. Otherwise, get them from $_wp_additional_image_sizes 
  6. if ( empty( $size ) ) { 
  7. return false; 
  8. } else if ( 'thumbnail' == $size ) { 
  9. $dimensions = array( 
  10. 'width' => get_option( 'thumbnail_size_w' ),  
  11. 'height' => get_option( 'thumbnail_size_h' ),  
  12. ); 
  13. } else { 
  14. global $_wp_additional_image_sizes; 
  15.  
  16. $dimensions = array( 
  17. 'width' => $_wp_additional_image_sizes[ $size ][ 'width' ],  
  18. 'height' => $_wp_additional_image_sizes[ $size ][ 'height' ],  
  19. ); 
  20.  
  21. return $dimensions;