[wp-hackers] Can't remove filter

Diana K. C dianakac at gmail.com
Mon Mar 4 23:58:28 UTC 2013


Hello,


I created a plugin and then a filter to add content after post titles but I can't figure out how to override some theme functions for excerpt_lenght:

Filter works ok with the_content, but not in the_excerpt because theme uses tie_excerpt instead, I tried remove_filter and create another function tied to excerpt_lenght but nothing happens.


function tie_excerpt_global_length( $length ) {
 if( tie_get_option( 'exc_length' ) )
  return tie_get_option( 'exc_length' );
 else return 60;
}


function tie_excerpt(){
 add_filter( 'excerpt_length', 'tie_excerpt_global_length', 999 );
 echo get_the_excerpt();
}

Thanks for any clue!



More information about the wp-hackers mailing list