eventsmanager

limit #_EVENTEXCERPT

Apr 5th, 2013
119
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×