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

Get a specific tracking argument for a given activity type


Parameters Parameters

$activity_type

(string) (Required) the activity type.

$arg

(string) (Optional) the key of the tracking argument.

Default value: ''


Top ↑

Return Return

(mixed) the value of the tracking arg, false if not found.


Source 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;
	}
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.