Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Apply Default Image for Jetpack
- * When looking for images in posts that falls under "is_singular"
- * and Jetpack does not find an image, we apply our own default image
- * instead of the blank WordPress thumb.
- * @version 1.0
- */
- add_filter( 'jetpack_images_get_images', 'apply_default_image_for_jetpack_seo', 10, 3 );
- function apply_default_image_for_jetpack_seo( $media, $post_id, $args ) {
- // Jetpack_PostImages::get_images did not find anything
- if ( ! $media && is_singular() ) {
- $media = array();
- $media[] = array( 'src' => 'http://site.com/default.png' );
- }
- return $media;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement