bp_activity_post_type_get_tracking_arg

Get a specific tracking argument for a given activity type.

Description

bp_activity_post_type_get_tracking_arg( (string) $activity_type, (string) $arg = '' ); 

Parameters (2)

0. $activity_type (string)
The activity type.
1. $arg — Optional. (string) => ''
The key of the tracking argument.

Usage

  1. if ( !function_exists( 'bp_activity_post_type_get_tracking_arg' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-functions.php'; 
  3.  
  4. // The activity type. 
  5. $activity_type = ''; 
  6.  
  7. // the key of the tracking argument. 
  8. $arg = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_activity_post_type_get_tracking_arg($activity_type, $arg); 
  12.  

Defined (1)

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

/bp-activity/bp-activity-functions.php  
  1. function bp_activity_post_type_get_tracking_arg( $activity_type, $arg = '' ) { 
  2. if ( empty( $activity_type ) || empty( $arg ) ) { 
  3. return false; 
  4.  
  5. $bp =buddypress); 
  6.  
  7. // Set the activity track global if not set yet 
  8. if ( empty( $bp->activity->track ) ) { 
  9. $bp->activity->track = bp_activity_get_post_types_tracking_args(); 
  10.  
  11. if ( isset( $bp->activity->track[ $activity_type ]->{$arg} ) ) { 
  12. return $bp->activity->track[ $activity_type ]->{$arg}; 
  13. } else { 
  14. return false;