In your filter, var_dump $date – what do you see ?
Hi @shanebp
If you take a look at the bp_format_time
function (I have copied to Pastie.org for easy access) you’ll see the $date
variable that is being returned needs both the $date
and $time
variables (see line 22):
http://pastie.org/8468225
return apply_filters( 'bp_format_time', $date )
only seems to allow me to pass $date
to my filter function. Is there a way to pass $time
variable as well or am I looking at this wrong?
$date doesn’t include the time unless $just_date is false.
$time is never sent as a separate variable.
So you’ll have to figure out how to call bp_format_time() without setting $just_date to true.
Or write your own function.
grep bp_format_time()
I think you’ll see that usually BP calls it with a true value for $just_date.
I’m actually looking at formatting the date in private messages and in that case WP doesn’t call the function with true
. $just_date
is set to false by default so that part is all good.
as you say I think i’ll have to write my own custom bp_format_time
function. Thanks for your help!
> looking at formatting the date in private messages … $just_date is false.
Then the filter will work fine.
The time will be part of the string passed in $date.
[ In your filter, var_dump $date – what do you see ? ]
You just have do some string and date operations on that string.
Ah got ya! Thanks @shanebp i’m on your wavelength now. $date
being a string I can perform some operations on.