Filter the default Open Graph Image tag, used when no Image can be found in a post.
Parameters
- $str
string Default Image URL.
Changelog
- Introduced in Jetpack 3.0.0
How to use this hook
Notes
You can use that filter to define a custom fallback image that will be used in Jetpack’s Open Graph Meta tags when no image can be found in a post.
function jeherve_default_image() {
$fallback_img = 'http://YOUR_IMG_URL';
return esc_url( $fallback_img );
}
add_filter( 'jetpack_open_graph_image_default', 'jeherve_default_image' );
Alternatively, you can also rely on the jetpack_images_get_images filter to define a fallback image that will be used in multiple areas of Jetpack (Open Graph Meta tags, Twitter Meta tags, Related Posts, and more).