[wp-trac] [WordPress Trac] #10395: wp_trim_excerpt() filterable [...] string

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 9 07:27:49 UTC 2009


#10395: wp_trim_excerpt() filterable [...] string
-----------------------+----------------------------------------------------
 Reporter:  ramiy      |        Type:  enhancement
   Status:  new        |    Priority:  normal     
Milestone:  2.9        |   Component:  Template   
  Version:  2.8        |    Severity:  normal     
 Keywords:  has-patch  |  
-----------------------+----------------------------------------------------

Comment(by stewartKnapman):

 Why not use php's preg_replace function?
 With a little regexp you can find the '[...]' and replace it with what
 ever you like.

 I just added this to my functions.php
 eg:

 {{{
 function moreLink($content){
         return preg_replace('/(\[...\])/','<small><a
 href="'.get_permalink().'">More ...</a></small>',$content);
 }
 add_filter('the_excerpt', 'moreLink');
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10395#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list