Advertisement
Guest User

Untitled

a guest
Jan 7th, 2020
936
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. function avia_logo( $use_image = '', $sub = '', $headline_type = 'h1', $dimension = '' )
  2. {
  3. $headline_type = apply_filters( 'avf_logo_headline', $headline_type );
  4. $sub = apply_filters( 'avf_logo_subtext', $sub );
  5. $alt = apply_filters( 'avf_logo_alt', get_bloginfo( 'name' ) );
  6. $link = apply_filters( 'avf_logo_link', home_url( '/' ) );
  7. $title = '';
  8.  
  9. if( $sub )
  10. {
  11. $sub = "<span class='subtext'>{$sub}</span>";
  12. }
  13.  
  14. if( $dimension === true )
  15. {
  16. $dimension = "height='100' width='300'"; //basically just for better page speed ranking :P
  17. }
  18.  
  19. $logo = avia_get_option( 'logo' );
  20. if( ! empty( $logo ) )
  21. {
  22. /**
  23. * @since 4.5.7.2
  24. * @return string
  25. */
  26. $logo = apply_filters( 'avf_logo', $logo, 'option_set' );
  27. if( is_numeric( $logo ) )
  28. {
  29. $logo_id = $logo;
  30. $logo = wp_get_attachment_image_src( $logo_id, 'full' );
  31. if( is_array( $logo ) )
  32. {
  33. $logo = $logo[0];
  34. $title = get_the_title( $logo_id );
  35. }
  36. }
  37.  
  38. /**
  39. * @since 4.5.7.2
  40. * @return string
  41. */
  42. $title = apply_filters( 'avf_logo_title', $title, 'option_set' );
  43.  
  44. $logo = "<img {$dimension} src='{$logo}' alt='{$alt}' title='{$title}' />";
  45. $logo = "<{$headline_type} class='logo'><a href='{$link}'>{$logo}{$sub}</a></{$headline_type}>";
  46. }
  47. else
  48. {
  49. $logo = get_bloginfo('name');
  50.  
  51. /**
  52. * @since 4.5.7.2
  53. * @return string
  54. */
  55. $use_image = apply_filters( 'avf_logo', $use_image, 'option_not_set' );
  56.  
  57. $use_image = '';
  58. if( ! empty( $use_image ) )
  59. {
  60. /**
  61. * @since 4.5.7.2
  62. * @return string
  63. */
  64. $title = apply_filters( 'avf_logo_title', $logo, 'option_not_set' );
  65. $logo = "<img {$dimension} src='{$use_image}' alt='{$alt}' title='{$title}'/>";
  66. }
  67.  
  68. $logo = "<{$headline_type} class='logo bg-logo'><a href='{$link}'>{$logo}{$sub}</a></{$headline_type}>";
  69. }
  70.  
  71. /**
  72. *
  73. * @since < 4.0
  74. * @param string
  75. * @param string $use_image
  76. * @param string $headline_type
  77. * @param string $sub
  78. * @param string $alt
  79. * @param string $link
  80. * @param string $title added 4.5.7.2
  81. * @return string
  82. */
  83. $logo = apply_filters( 'avf_logo_final_output', $logo, $use_image, $headline_type, $sub, $alt, $link, $title );
  84.  
  85. return $logo;
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement