Plugin Directory

Changeset 795516

Timestamp:
10/29/2013 11:19:18 PM (11 years ago)
Author:
jshreve
Message:

Open Graph

Updates to Open Graph Tags:

  • Cleaner Description
  • Fall back to mshot so Facebook never pulls in the spinner
  • support secure_images and their arrays if some get passed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • jetpack/trunk/functions.opengraph.php

    r719878 r795516  
    6363        $tags['og:url']         = get_permalink( $data->ID );
    6464        if ( !post_password_required() )
    65             $tags['og:description'] = ! empty( $data->post_excerpt ) ? strip_shortcodes( wp_kses( $data->post_excerpt, array() ) ) : wp_trim_words( strip_shortcodes( wp_kses( $data->post_content, array() ) ) );
     65            $tags['og:description'] = ! empty( $data->post_excerpt ) ? ) ) ) );
    6666        $tags['og:description'] = empty( $tags['og:description'] ) ? ' ' : $tags['og:description'];
    6767    }
     
    8686    // Add any additional tags here, or modify what we've come up with
    8787    $tags = apply_filters( 'jetpack_open_graph_tags', $tags, compact( 'image_width', 'image_height' ) );
     88
     89
     90
     91
     92
    8893
    8994    foreach ( (array) $tags as $tag_property => $tag_content ) {
     
    98103            $og_output .= apply_filters( 'jetpack_open_graph_output', $og_tag );
    99104            $og_output .= "\n";
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
    100118        }
    101119    }
     
    150168    }
    151169
    152     // Fallback to Blavatar if available
    153     if ( function_exists( 'blavatar_domain' ) ) {
    154         $blavatar_domain = blavatar_domain( site_url() );
    155         if ( empty( $image ) && blavatar_exists( $blavatar_domain ) )
    156             $image = blavatar_url( $blavatar_domain, 'img', $width );
     170    // Fallback to Mshot
     171    if ( empty( $image ) ) {
     172        $image = 'http://s.wordpress.com/mshots/v1/' . urlencode( get_permalink( $post->ID ) );
    157173    }
    158174
Note: See TracChangeset for help on using the changeset viewer.