bp_is_current_action( string $action = '' )

Check to see whether the current page matches a given action.

Description

Along with bp_is_current_component() and bp_is_action_variable(), this function is mostly used to help determine when to use a given screen function.

In BP parlance, the current_action is the URL chunk that comes directly after the current item slug. E.g., in http://example.com/groups/my-group/members the current_action is ‘members’.

Parameters

$action

(Optional) The action being tested against.

Default value: ''

Return

(bool) True if the current action matches $action.

Source

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

function bp_is_current_action( $action = '' ) {
	return (bool) ( $action === bp_current_action() );
}

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.