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

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 9 16:02:33 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 ramiy):

 This is a very nice solution but it doe's not provide a general solutin to
 the real problem - The '''the_content_more_link''' filter does not work
 when using '''the_excerpt()''' function.

 Besides, the solution must be in the wp core whitout using
 '''functions.php''' file.

 Adding a new filter to '''wp_trim_excerpt()''' function is simpler to use
 and it workes the same as $excerpt_length filter.

 {{{
 // Changing excerpt length
 function new_excerpt_length($length) {
         return 20;
 }
 add_filter('excerpt_length', 'new_excerpt_length');

 // Changing excerpt more
 function new_excerpt_more($more) {
         return '.....';
 }
 add_filter('excerpt_more', 'new_excerpt_more');

 }}}

 bouth filters are in '''wp_trim_excerpt()''' function.

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


More information about the wp-trac mailing list