- InactiveLevel: EnlightenedPosts: 28
Please is there a snippet that can add (new) to latest buddypress activity post if there is can you assist me with it
- InactiveLevel: EnlightenedPosts: 28
Not #tag
What I meant is that when a new activity post is published
I want to display (new) beside the activity time area
Like an indicator that tells members that this activity was just published
- This reply was modified 3 years, 7 months ago by Kikismedia.
- InactiveLevel: EnlightenedPosts: 28
Hello Adeala,
Please try the following code. It will “(new)” to activity which posted within 5 minutes.
add_filter( 'bp_activity_time_since', function ( $time_since, $activity ) { // Assuming last 5 minutes posted activity as new. $new_activity_time = strtotime( bp_core_current_time() ) - 5 * 60; if ( strtotime( $activity->date_recorded ) >= $new_activity_time ) { $time_since = __( '(new)' ); } return $time_since; }, 10, 2 );
Regards
Ravi- InactiveLevel: EnlightenedPosts: 28
Thanks Ravi it worked perfectly
Can you help add CSS to the (new)
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.
This topic is: not resolved