gravityflow_web_api_capability_get_entries_assignees

Description

The gravityflow_web_api_capability_get_entries_assignees filter allows developers to customize the capability required to retrieve the assignees for a specific entry via the Gravity Flow Web API. By default, this capability is set to gravityflow_create_steps, but you can use this filter to require a different capability or add custom logic.

Usage

add_filter('gravityflow_web_api_capability_get_entries_assignees', 'my_custom_function', 10, 1);

Parameters

ParameterTypeDetails
$capabilitystringThe capability required to process the API request.

Examples

Require a custom capability for retrieving entry assignees.

add_filter( 'gravityflow_web_api_capability_get_entries_assignees', function( $capability ) {

    // Require users to have the 'read' capability instead
    return 'read';
}, 10, 1 );

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

This filter is located in includes/class-web-api.php