gravityflow_web_api_capability_post_entries_assignees

Description

The gravityflow_web_api_capability_post_entries_assignees filter allows developers to customize the capability required to update the status of an assignee for a workflow step via the Gravity Flow WEB API.

Usage

1
add_filter('gravityflow_web_api_capability_post_entries_assignees', 'my_custom_function', 10, 1)

Parameters

ParameterTypeDetails
$capabilitystringThe capability required to process the API request.

Examples

Require a Custom Capability for API Updates

1
2
3
4
5
6
7
add_filter( 'gravityflow_web_api_capability_post_entries_assignees', 'my_custom_api_capability' );
function my_custom_api_capability( $capability ) {
 
    // Require users to have the 'edit_others_posts' capability instead
   // The default capability is gravityflow_create_steps
    return 'edit_others_posts';
}

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