bp_activity_timestamp_class

Check if Activity Heartbeat feature i on to add a timestamp class.

Description

(string) bp_activity_timestamp_class( (string) $classes = '' ); 

Returns (string)

$classes

Parameters (1)

0. $classes — Optional. (string) => ''
Array of classes for timestamp.

Usage

  1. if ( !function_exists( 'bp_activity_timestamp_class' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-filters.php'; 
  3.  
  4. // Array of classes for timestamp. 
  5. $classes = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_activity_timestamp_class($classes); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-activity/bp-activity-filters.php  
  1. function bp_activity_timestamp_class( $classes = '' ) { 
  2.  
  3. if ( ! bp_activity_do_heartbeat() ) { 
  4. return $classes; 
  5.  
  6. $activity_date = bp_get_activity_date_recorded(); 
  7.  
  8. if ( empty( $activity_date ) ) { 
  9. return $classes; 
  10.  
  11. $classes .= ' date-recorded-' . strtotime( $activity_date ); 
  12.  
  13. return $classes;