Changeset 516756
- Timestamp:
- 03/09/2012 01:46:14 PM (14 years ago)
- File:
-
- 1 edited
-
flattr/trunk/flattr.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flattr/trunk/flattr.php
r508984 r516756 394 394 */ 395 395 public function injectIntoTheContent($content) { 396 static $processingPosts = array(); 397 396 398 global $post; 397 399 … … 405 407 406 408 if (in_array(get_post_type(), (array)get_option('flattr_post_types', array())) && !is_feed()) { 409 if (isset($processingPosts[$post->ID])) { 410 return $content; 411 } else { 412 $processingPosts[$post->ID] = true; 413 } 407 414 $button = $this->getButton(); 408 415 $button = '<p class="wp-flattr-button">'.$button.'</p>'; … … 414 421 $content = $content . $button; 415 422 } 423 unset($processingPosts[$post->ID]); 416 424 } 417 425 return $content; … … 456 464 $hidden = get_option('flattr_hide', false); 457 465 } 466 467 $description = get_the_content(''); 468 $description = strip_shortcodes( $description ); 469 $description = apply_filters('the_content', $description); 470 $description = str_replace(']]>', ']]>', $description); 471 $description = wp_trim_words( $description, 30, '...' ); 458 472 459 473 $buttonData = array( … … 466 480 'category' => $selectedCategory, 467 481 'title' => strip_tags(get_the_title()), 468 'description' => strip_tags(preg_replace('/\<br\s*\/?\>/i', "\n", $post->post_content)),482 'description' => $description, 469 483 'tags' => trim(strip_tags(get_the_tag_list('', ',', '')) . ',' . $additionalTags, ', ') 470 484
Note: See TracChangeset
for help on using the changeset viewer.