Changeset 2443
- Timestamp:
- 03/14/2005 01:02:04 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/markdown.php
r2128 r2443 46 46 add_filter('the_content', 'Markdown', 6); 47 47 add_filter('the_excerpt', 'Markdown', 6); 48 add_filter('the_excerpt_rss', 'Markdown', 6); 48 49 add_filter('comment_text', 'Markdown', 6); 49 50 } -
trunk/wp-includes/functions-formatting.php
r2428 r2443 643 643 } 644 644 645 function wp_trim_excerpt( $text) { // Fakes an excerpt if needed645 function wp_trim_excerpt($text) { // Fakes an excerpt if needed 646 646 global $post; 647 647 if ( '' == $text ) { 648 648 $text = $post->post_content; 649 $text = strip_tags( $text ); 650 $blah = explode(' ', $text); 649 $text = apply_filters('the_content', $text); 650 $text = str_replace(']]>', ']]>', $text); 651 $text = strip_tags($text); 651 652 $excerpt_length = 55; 652 if (count($blah) > $excerpt_length) { 653 $k = $excerpt_length; 654 $use_dotdotdot = 1; 655 } else { 656 $k = count($blah); 657 $use_dotdotdot = 0; 658 } 659 $excerpt = ''; 660 for ($i=0; $i<$k; $i++) { 661 $excerpt .= $blah[$i].' '; 662 } 663 $excerpt .= ($use_dotdotdot) ? '[...]' : ''; 664 $text = $excerpt; 665 } // end if no excerpt 653 $words = explode(' ', $text, $excerpt_length + 1); 654 if (count($words) > $excerpt_length) { 655 array_pop($words); 656 array_push($words, '[...]'); 657 $text = implode(' ', $words); 658 } 659 } 666 660 return $text; 667 661 }
Note: See TracChangeset
for help on using the changeset viewer.