bp_activity_post_type_get_tracking_arg( string $activity_type, string $arg = '' )
Get a specific tracking argument for a given activity type
Description
Parameters
- $activity_type
-
(string) (Required) the activity type.
- $arg
-
(string) (Optional) the key of the tracking argument.
Default value: ''
Return
(mixed) the value of the tracking arg, false if not found.
Source
File: bp-activity/bp-activity-functions.php
function bp_activity_post_type_get_tracking_arg( $activity_type, $arg = '' ) { if ( empty( $activity_type ) || empty( $arg ) ) { return false; } $bp = buddypress(); // Set the activity track global if not set yet if ( empty( $bp->activity->track ) ) { $bp->activity->track = bp_activity_get_post_types_tracking_args(); } if ( isset( $bp->activity->track[ $activity_type ]->{$arg} ) ) { return $bp->activity->track[ $activity_type ]->{$arg}; } else { return false; } }
Changelog
Version | Description |
---|---|
BuddyPress 2.5.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.