bp_action_variable( int $position )

Return the value of a given action variable.

Description

Parameters

$position

(Required) The key of the action_variables array that you want.

Return

(string|bool) $action_variable The value of that position in the array, or false if not found.

Source

File: bp-core/bp-core-template.php

function bp_action_variable( $position = 0 ) {
	$action_variables = bp_action_variables();
	$action_variable  = isset( $action_variables[ $position ] )
		? $action_variables[ $position ]
		: false;

	/**
	 * Filters the value of a given action variable.
	 *
	 * @since BuddyPress 1.5.0
	 *
	 * @param string|bool $action_variable Requested action variable based on position.
	 * @param int         $position        The key of the action variable requested.
	 */
	return apply_filters( 'bp_action_variable', $action_variable, $position );
}

Changelog

Changelog
Version Description
BuddyPress 1.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.