Created
July 31, 2018 17:02
-
-
Save nickcernis/7748aa599161d3a0bb0a804c250333af to your computer and use it in GitHub Desktop.
Fix Google Schema error for custom logos on WordPress sites.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Fix Google Schema error, "The property logo is not recognised by Google for an object of type WPHeader". | |
* | |
* @param string $html The logo HTML. | |
* | |
* @return string The modified HTML. | |
*/ | |
add_filter( 'get_custom_logo', function( $html ) { | |
$html = str_replace( 'itemprop="logo"', 'itemprop="image"', $html ); | |
return $html; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment