bp_is_current_action( string $action = '' )

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


Description 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 Parameters

$action

(Optional) The action being tested against.

Default value: ''


Top ↑

Return Return

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


Top ↑

Source Source

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

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

Top ↑

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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