Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Shorter Freshness Titles

@blg002

Participant

@thesnowjunkies @johnjamesjacoby @undyingearth @olivier-lettinga So here’s what I did, it looks to work but I haven’t fully put it through its paces. I’m also kind of a n00b with this PHP WordPress thing so hopefully this isn’t a terrible idea. I basically used an add filter on bbp_get_time_since and did a regex string replacement on the output removing anything from the first comma up to ‘ago’.

function short_freshness_time( $output, $older_date, $newer_date ) {
  $output = preg_replace( '/, .*[^ago]/', ' ', $output );
  return $output;
}
add_filter( 'bbp_get_time_since', 'short_freshness_time' );
Skip to toolbar