Replace open graph tags with Jetpack implementation

This commit is contained in:
2019-02-02 23:30:14 +00:00
parent 2eabf5a4b3
commit f5198270f2
2 changed files with 19 additions and 8 deletions

View File

@@ -150,3 +150,22 @@ function windycoys_is_ie() {
}
return false;
}
function windycoys_jetpack_custom_image($media, $post_id, $args) {
if ($media) {
return $media;
} else {
$url = get_template_directory_uri() . '/images/icon.png';
$permalink = get_permalink($post_id);
return array(
array(
'type' => 'image',
'from' => 'custom_fallback',
'src' => esc_url($url),
'href' => $permalink,
)
);
}
}
add_filter('jetpack_images_get_images', 'windycoys_jetpack_custom_image', 10, 3);