gravityflow_web_api_capability_get_entries_steps

Description

The gravityflow_web_api_capability_get_entries_steps filter allows developers to customize the capability required to retrieve the workflow steps 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_steps', 'my_custom_function', 10, 1);

Parameters

ParameterTypeDetails
$capabilitystringThe capability required to process the API request.

Examples

Require a custom capability for retrieving entry steps.

add_filter( 'gravityflow_web_api_capability_get_entries_steps', 'gfw_custom_get_steps_capability', 10, 1 );
function gfw_custom_get_steps_capability( $capability ) {
    // Require users to have the 'read' capability instead
    return 'read';
}

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