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

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 9 07:34:10 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 dd32):

 > I just added this to my functions.php eg:

 Just note that that doesnt work as you expect. It'll also replace [ABC]
 with the more link..

 Since you're not using a regular expression, you're better off using
 str_replace:

 {{{
 function moreLink($content){
         return str_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:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list