Skip to content

Instantly share code, notes, and snippets.

@adamsilverstein
Last active October 30, 2020 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamsilverstein/712dae49f0df58f0204c32e171b68e5c to your computer and use it in GitHub Desktop.
Save adamsilverstein/712dae49f0df58f0204c32e171b68e5c to your computer and use it in GitHub Desktop.
wpml-test-fix.php
<?php
/**
* Ensures Site Kit WPML compatibility.
*
* @wordpress-plugin
* Plugin Name: Fix Site Kit WPML compatibility
* Description: Ensures Site Kit WPML compatibility.
* Plugin URI:
* Version: 1.0.0
* Author: Adam Silverstein, Google
* License: Apache License 2.0
* License URI: https://www.apache.org/licenses/LICENSE-2.0
*/
add_filter(
'googlesitekit_canonical_home_url',
function( $url ) {
return( apply_filters( 'wpml_permalink', $url, apply_filters( 'wpml_default_language', '' ) ) );
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment