Plugin Directory

Changeset 1320972


Ignore:
Timestamp:
01/04/2016 02:40:59 PM (10 years ago)
Author:
whatadewitt
Message:

version 2.0.1 updates/fixes

Location:
deweys-twitter-card-helper
Files:
11 added
3 edited

Legend:

Unmodified
Added
Removed
  • deweys-twitter-card-helper/trunk/README.txt

    r1257848 r1320972  
    44Requires at least: 3.5.1
    55Tested up to: 4.0
    6 Stable tag: 2.0.0
     6Stable tag: 2.0.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3535You can!
    3636
     37... you actually SHOULD. It's recommended that you add a filter on "twitter_cards" to update the "site" property to be the proper Twitter username, otherwise your twitter card settings will use @undefined by default.
     38
    3739You can customize all of the different posts you're supporting using the `og_tags` filter. Also, if you're supporting multiple post types and only want to customize a particular post type, you can use the `[POST_TYPE]_og_tags` filter, where you can replace `[POST_TYPE]` with `post` or `page` (or whatever the post_type is) to customize the content of a particular post type.
    3840
     41
     42
    3943== Changelog ==
     44
     45= 2.0.1 =
     46* fixed an issue where our meta tag was not named properly
     47* cleaned up a problem with some data not being rendered properly
    4048
    4149= 2.0.0 =
  • deweys-twitter-card-helper/trunk/class-wad_twitter_cards.php

    r1257848 r1320972  
    2525   * @var     string
    2626   */
    27   protected $version = '2.0.0';
     27  protected $version = '2.0.1';
    2828
    2929  /**
     
    127127          $excerpt = substr($excerpt, 0, 100);
    128128          $excerpt = $excerpt.'...';
    129           $excerpt = addslashes($excerpt);
    130129        }
    131130
    132131        //Define defaults
    133         $tags['twitter:card'] = 'summary';
    134         $tags['twitter:site'] = '@undefined'; // YO! This should definitely be updated with the twitter_cards filter
    135         $tags['twitter:title'] = get_the_title();
    136         $tags['twitter:url'] = get_permalink();
    137         $tags['twitter:description'] = $excerpt;
     132        $tags['card'] = 'summary';
     133        $tags['site'] = '@undefined'; // YO! This should definitely be updated with the twitter_cards filter
     134        $tags['title'] = get_the_title();
     135        $tags['url'] = get_permalink();
     136        $tags['description'] = $excerpt;
    138137
    139138        if ( $tc_title = get_post_meta($post->ID, 'twitter_title', true) ) {
    140           $tags['twitter:title'] = $tc_title;
     139          $tags['title'] = $tc_title;
    141140        }
    142141
    143142        if ( $tc_desc = get_post_meta($post->ID, 'twitter_desc', true) ) {
    144           $tags['twitter:description'] = $tc_desc;
     143          $tags['description'] = $tc_desc;
    145144        }
    146145
    147146        if ( $tc_type = get_post_meta($post->ID, 'twitter_type', true) ) {
    148           $tags['twitter:card'] = $tc_type;
     147          $tags['card'] = $tc_type;
    149148        }
    150149
     
    152151        if ( current_theme_supports('post-thumbnails') && has_post_thumbnail( $post->ID ) ) {
    153152          $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium', false);
    154           $tags['twitter:image'] = $thumbnail[0];
     153          $tags['image'] = $thumbnail[0];
    155154        }
    156155
    157156        $tags = apply_filters( 'twitter_cards', $tags );
    158157        $tags = apply_filters( "{$post->post_type}_twitter_cards", $tags );
    159 
    160158      }
    161159    } else if ( is_front_page() ) {
    162       $tags['twitter:card'] = get_bloginfo( 'name' );
    163       $tags['twitter:site'] = get_bloginfo( 'name' );
    164       $tags['twitter:creator'] = 'website';
    165       $tags['twitter:url'] = get_bloginfo( 'url' );
    166       $tags['twitter:description'] = get_bloginfo( 'description' );
     160      $tags['card'] = get_bloginfo( 'name' );
     161      $tags['site'] = get_bloginfo( 'name' );
     162      $tags['creator'] = 'website';
     163      $tags['url'] = get_bloginfo( 'url' );
     164      $tags['description'] = get_bloginfo( 'description' );
     165
     166      $tags = apply_filters( 'twitter_cards', $tags );
     167      $tags = apply_filters( "front_page_twitter_cards", $tags );
    167168    }
    168169
    169170    //filter post tags
    170171    foreach ( $tags as $key => $value ) {
    171       echo "<meta name='" . $key . "' content='" . $value . "' />\n";
     172      echo("<meta name=\"twitter:" . $key . "\" content=\"" . htmlentities($value) . "\" />\n");
    172173    }
    173174  }
  • deweys-twitter-card-helper/trunk/wad_twitter_cards.php

    r1257848 r1320972  
    1111 * Plugin URI:  http://www.whatadewitt.ca
    1212 * Description: Simplifies the use of Twitter Cards in WP
    13  * Version:     2.0.0
     13 * Version:     2.0.1
    1414 * Author:      Luke DeWitt
    1515 * Author URI:  http://www.whatadewitt.ca
Note: See TracChangeset for help on using the changeset viewer.