Last active
March 14, 2018 17:02
-
-
Save kristarella/e0efbac9011708f3c9ee34106b6f202a to your computer and use it in GitHub Desktop.
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 | |
/* | |
Plugin Name: Force HTTP sharing URL | |
Description: Make og:url HTTP in Yoast and Jetpack meta data | |
Version: 20181127 | |
Author: kristarella | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html | |
*/ | |
/* Enforce HTTP Open Graph URLs in Yoast SEO | |
* Credit: stodorovic https://github.com/stodorovic | |
* Last Tested: Feb 06 2017 using Yoast SEO 5.8 on WordPress 4.8.2 | |
*/ | |
add_filter( 'wpseo_opengraph_url', 'yoast_http_og_url' ); | |
function yoast_http_og_url( $url ) { | |
return str_replace( 'https://', 'http://', $url ); | |
} | |
/* Enforce HTTP Open Graph URLs in Jetpack | |
* | |
*/ | |
add_filter( 'jetpack_open_graph_tags', 'jetpack_http_og_url' ); | |
function jetpack_http_og_url( $tags ) { | |
$tags['og:url'] = str_replace( 'https://', 'http://', $tags['og:url'] ); | |
return $tags; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment