Changeset 1320972
- Timestamp:
- 01/04/2016 02:40:59 PM (10 years ago)
- Location:
- deweys-twitter-card-helper
- Files:
-
- 11 added
- 3 edited
-
tags/2.0.1 (added)
-
tags/2.0.1/LICENSE.txt (added)
-
tags/2.0.1/README.txt (added)
-
tags/2.0.1/class-wad_twitter_cards.php (added)
-
tags/2.0.1/css (added)
-
tags/2.0.1/css/admin.css (added)
-
tags/2.0.1/index.php (added)
-
tags/2.0.1/templates (added)
-
tags/2.0.1/templates/twittercardform.php (added)
-
tags/2.0.1/uninstall.php (added)
-
tags/2.0.1/wad_twitter_cards.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/class-wad_twitter_cards.php (modified) (3 diffs)
-
trunk/wad_twitter_cards.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
deweys-twitter-card-helper/trunk/README.txt
r1257848 r1320972 4 4 Requires at least: 3.5.1 5 5 Tested up to: 4.0 6 Stable tag: 2.0. 06 Stable tag: 2.0.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 35 35 You can! 36 36 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 37 39 You 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. 38 40 41 42 39 43 == 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 40 48 41 49 = 2.0.0 = -
deweys-twitter-card-helper/trunk/class-wad_twitter_cards.php
r1257848 r1320972 25 25 * @var string 26 26 */ 27 protected $version = '2.0. 0';27 protected $version = '2.0.1'; 28 28 29 29 /** … … 127 127 $excerpt = substr($excerpt, 0, 100); 128 128 $excerpt = $excerpt.'...'; 129 $excerpt = addslashes($excerpt);130 129 } 131 130 132 131 //Define defaults 133 $tags[' twitter:card'] = 'summary';134 $tags[' twitter:site'] = '@undefined'; // YO! This should definitely be updated with the twitter_cards filter135 $tags['t witter: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; 138 137 139 138 if ( $tc_title = get_post_meta($post->ID, 'twitter_title', true) ) { 140 $tags['t witter:title'] = $tc_title;139 $tags['title'] = $tc_title; 141 140 } 142 141 143 142 if ( $tc_desc = get_post_meta($post->ID, 'twitter_desc', true) ) { 144 $tags[' twitter:description'] = $tc_desc;143 $tags['description'] = $tc_desc; 145 144 } 146 145 147 146 if ( $tc_type = get_post_meta($post->ID, 'twitter_type', true) ) { 148 $tags[' twitter:card'] = $tc_type;147 $tags['card'] = $tc_type; 149 148 } 150 149 … … 152 151 if ( current_theme_supports('post-thumbnails') && has_post_thumbnail( $post->ID ) ) { 153 152 $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]; 155 154 } 156 155 157 156 $tags = apply_filters( 'twitter_cards', $tags ); 158 157 $tags = apply_filters( "{$post->post_type}_twitter_cards", $tags ); 159 160 158 } 161 159 } 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 ); 167 168 } 168 169 169 170 //filter post tags 170 171 foreach ( $tags as $key => $value ) { 171 echo "<meta name='" . $key . "' content='" . $value . "' />\n";172 echo("<meta name=\"twitter:" . $key . "\" content=\"" . htmlentities($value) . "\" />\n"); 172 173 } 173 174 } -
deweys-twitter-card-helper/trunk/wad_twitter_cards.php
r1257848 r1320972 11 11 * Plugin URI: http://www.whatadewitt.ca 12 12 * Description: Simplifies the use of Twitter Cards in WP 13 * Version: 2.0. 013 * Version: 2.0.1 14 14 * Author: Luke DeWitt 15 15 * Author URI: http://www.whatadewitt.ca
Note: See TracChangeset
for help on using the changeset viewer.