advantage_logo_image

The Advantage advantage logo image function.

Description

advantage_logo_image( $header_image, (string) $size = 'full' ); 

Parameters (2)

0. $header_image
The header image.
1. $size — Optional. (string) => 'full'
The size.

Usage

  1. if ( !function_exists( 'advantage_logo_image' ) ) { 
  2. require_once '/inc/lib-content.php'; 
  3.  
  4. // The header image. 
  5. $header_image = null; 
  6.  
  7. // The size. 
  8. $size = 'full'; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = advantage_logo_image($header_image, $size); 
  12.  

Defined (1)

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

/inc/lib-content.php  
  1. function advantage_logo_image( $header_image, $size = 'full' ) { 
  2. $html = ''; 
  3. // $header_image = get_header_image(); 
  4. if ( ! empty( $header_image ) ) { 
  5. if( function_exists( 'get_custom_header' ) ) { 
  6. $header_width = get_custom_header() -> width; 
  7. $header_height = get_custom_header() -> height; 
  8. else { 
  9. $header_width = HEADER_IMAGE_WIDTH; 
  10. $header_height = HEADER_IMAGE_HEIGHT;  
  11. if ( 'full' != $size ) { 
  12. $ratio = $size / $header_height; 
  13. $header_height = (int) $header_height * $ratio; 
  14. $header_width = (int) $header_width * $ratio;  
  15. $html = '<img src="' . esc_url( $header_image ) . '" width="'; 
  16. $html .= $header_width . '" height="' . $header_height; 
  17. $html .= '" alt="' . get_bloginfo( 'name') . '" />'; 
  18. }  
  19. echo apply_filters( 'advantage_logo_image', $html );