apply_filters( 'cloudinary_task_capability', $capability, $task, $context, $args ) → {string}
Filter the capability required for Cloudinary tasks.
Parameters:
Name | Type | Description |
---|---|---|
$capability |
string | The current capability for the task. |
$task |
string | The task. |
$context |
string | The context for the task. |
$args |
mixed | The optional arguments. |
- Since:
- 2.7.6. In 3.0.6 $context and $args added.
- Source:
Returns:
- Type
- string
Example
<?php
// Enforce `manage_options` to download an asset from Cloudinary.
add_filter(
'cloudinary_task_capability',
function( $capability, $task, $context ) {
if ( 'manage_assets' === $task && 'download' === $context ) {
$capability = 'manage_options';
}
return $capability;
},
10,
3
);