Astra_Ext_Sticky_Header_Markup::none_custom_logo( String $html )
Filter the output of logo to fix Googles Error about itemprop logo.
Description
Parameters
- $html
-
(String) (Required) HTML Markup of the logo.
Return
(String) Custom logo HTML output
Source
File: addons/sticky-header/classes/class-astra-ext-sticky-header-markup.php
public function none_custom_logo( $html ) { $header_logo = astra_get_option( 'sticky-header-logo' ); if ( '' !== $header_logo ) { add_filter( 'wp_get_attachment_image_attributes', array( $this, 'sticky_replace_header_logo_attr' ), 10, 3 ); $custom_logo_id = attachment_url_to_postid( $header_logo ); $size = 'ast-sticky-logo-size'; if ( is_customize_preview() ) { $size = 'full'; } $logo = sprintf( '<a href="%1$s" class="sticky-custom-logo" rel="home" %3$s>%2$s</a>', esc_url( home_url( '/' ) ), wp_get_attachment_image( $custom_logo_id, $size, false, array( 'class' => 'custom-logo', ) ), astra_attr( 'site-title-none-sticky-custom-link', array( 'class' => '', ) ) ); remove_filter( 'wp_get_attachment_image_attributes', array( $this, 'sticky_replace_header_logo_attr' ) ); $html = $html . $logo; } return $html; }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |