WordPress.org

Plugin Directory

Changeset 622242


Ignore:
Timestamp:
11/07/12 19:13:13 (18 months ago)
Author:
tmoorewp
Message:

Open Graph: Add filters for including Jetpack's version of Open Graph tags. If Facebook's official plugin is active on a site, do not use Jetpack's version of OG.

Location:
jetpack/trunk
Files:
2 edited

Legend:

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

    r618654 r622242  
    1515        return; 
    1616 
    17     $og_output = ''; 
     17    $og_output = "\n<!-- Jetpack Open Graph Tags -->\n"; 
    1818    $tags = array(); 
    1919 
     
    7676    // Add any additional tags here, or modify what we've come up with 
    7777    $tags = apply_filters( 'jetpack_open_graph_tags', $tags ); 
    78  
     78     
    7979    foreach ( (array) $tags as $tag_property => $tag_content ) { 
    8080        foreach ( (array) $tag_content as $tag_content_single ) { // to accomodate multiple images 
  • jetpack/trunk/jetpack.php

    r622211 r622242  
    44154415 
    44164416if ( in_array( 'publicize', Jetpack::get_active_modules() ) || in_array( 'sharedaddy', Jetpack::get_active_modules() ) ) 
    4417     require_once dirname( __FILE__ ) . '/functions.opengraph.php'; 
     4417        add_filter( 'jetpack_enable_opengraph', '__return_true', 0 ); 
     4418 
     4419$active_plugins = get_option( 'active_plugins', array() ); 
     4420 
     4421if ( in_array( 'facebook/facebook.php', $active_plugins ) ) 
     4422        add_filter( 'jetpack_enable_opengraph', '__return_false', 99 ); 
     4423 
     4424if ( apply_filters( 'jetpack_enable_opengraph', false ) ) 
     4425        require_once dirname( __FILE__ ) . '/functions.opengraph.php'; 
    44184426 
    44194427class Jetpack_Error extends WP_Error {} 
Note: See TracChangeset for help on using the changeset viewer.