Advertisement
eventsmanager

limit #_EVENTEXCERPT

Apr 5th, 2013
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function my_em_mod_excerpt_placeholders($replace, $EM_Event, $result){
  2. if ( $result == '#_EVENTEXCERPT' ) {
  3. $replace = preg_replace('/<img[^>]+./','', $replace);
  4. if ( str_word_count($replace) > 25 ) {
  5. $length = 25;
  6. $replace = implode(' ',array_slice(explode(' ', $replace),0,$length));
  7. $replace = $replace . '... ';
  8. }
  9. }
  10. return $replace;
  11. }
  12. add_filter('em_event_output_placeholder','my_em_mod_excerpt_placeholders',1,3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement