From 52bd1d429d613038ac88c15aec1b2fa5553e69ce Mon Sep 17 00:00:00 2001 From: Pierre Dargham Date: Tue, 4 Jul 2017 17:32:24 +0200 Subject: [PATCH] Fix SEO Framework social image : unhook relative-url during SEO Framework meta generation --- modules/relative-urls.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/relative-urls.php b/modules/relative-urls.php index ef11196a..023e72cb 100644 --- a/modules/relative-urls.php +++ b/modules/relative-urls.php @@ -49,6 +49,9 @@ /** * Compatibility with The SEO Framework */ -Utils\add_filters(['the_seo_framework_ogimage_output', 'the_seo_framework_twitterimage_output'], function ($image) { - return 0 === strpos($image, home_url()) ? $image : home_url($image); +add_action('the_seo_framework_do_before_output', function () { + remove_filter('wp_get_attachment_url', 'Roots\\Soil\\Utils\\root_relative_url'); +}); +add_action('the_seo_framework_do_after_output', function () { + add_filter('wp_get_attachment_url', 'Roots\\Soil\\Utils\\root_relative_url'); });