Changeset 231542
- Timestamp:
- 04/21/2010 12:14:15 PM (16 years ago)
- Location:
- flattr/trunk
- Files:
-
- 2 edited
-
flattr.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
flattr/trunk/flattr.php
r227897 r231542 4 4 Plugin URI: http://api.flattr.com/plugins/ 5 5 Description: Give your readers the opportunity to Flattr your effort 6 Version: 0. 46 Version: 0.5 7 7 Author: Flattr.com 8 8 Author URI: http://flattr.com/ … … 11 11 // Defines 12 12 13 define(FLATTR_WP_VERSION, '0. 4');13 define(FLATTR_WP_VERSION, '0.5'); 14 14 define(FLATTR_WP_SCRIPT, 'http://api.flattr.com/button/load.js'); 15 15 … … 25 25 if (get_option('flattr_aut', 'on') == 'on') 26 26 { 27 remove_filter('get_the_excerpt', 'wp_trim_excerpt'); 27 28 add_filter('get_the_excerpt', create_function('$content', 'remove_filter("the_content", "flattr_the_content"); return $content;'), 9); 28 29 add_filter('get_the_excerpt', create_function('$content', 'add_filter("the_content", "flattr_the_content"); return $content;'), 11); … … 110 111 if (strlen($uid) && strlen($cat)) 111 112 { 112 return flattr_permalink($uid, $cat, get_the_title(), get_the_excerpt(), strip_tags(get_the_tag_list('', ',', '')), get_permalink());113 return flattr_permalink($uid, $cat, get_the_title(), flattr_get_excerpt(), strip_tags(get_the_tag_list('', ',', '')), get_permalink()); 113 114 } 114 115 } 116 117 function flattr_get_excerpt( $excerpt_max_length = 1024 ) 118 { 119 global $post; 120 $excerpt = $post->post_excerpt; 121 if (! $excerpt) 122 { 123 $excerpt = $post->post_content; 124 $excerpt = strip_shortcodes( $excerpt ); 125 $excerpt = str_replace(']]>', ']]>', $excerpt); 126 $excerpt = strip_tags($excerpt); 127 } 128 129 // Try to shorten without breaking words 130 if ( strlen($excerpt) > $excerpt_max_length ) 131 { 132 $pos = strpos($excerpt, ' ', $excerpt_max_length); 133 if ($pos !== false) 134 { 135 $excerpt = substr($excerpt, 0, $pos); 136 } 137 } 138 139 // If excerpt still too long 140 if ( strlen($excerpt) > $excerpt_max_length ) 141 { 142 $excerpt = substr($excerpt, 0, $excerpt_max_length); 143 } 144 return $excerpt; 145 } 146 115 147 116 148 function the_flattr_permalink() -
flattr/trunk/readme.txt
r227897 r231542 32 32 == Changelog == 33 33 34 = 0.5 = 35 * Fixed a bug that caused blog posts to display incorrectly when no excerpt was entered. 36 34 37 = 0.4 = 35 38 * First public version 36 39 37 40 == Upgrade Notice == 41 42 = 0.5 = 43 Previous version makes your blog posts display incorrectly if you don't enter an excerpt. 38 44 39 45 = 0.4 =
Note: See TracChangeset
for help on using the changeset viewer.