WP Webhooks / Docs / fswa_glue_capability
Filter since v3.0.0

fswa_glue_capability

Sets the WordPress capability required to write Code Glue snippets.

$

/ Signature

apply_filters( 'fswa_glue_capability', $capability )

/ When it fires

Fires whenever the plugin checks whether the current user may write a Code Glue snippet. Users without the capability are told to ask an administrator.

/ Parameters

NameInTypeReqDescription
$capabilityparamstringyesCapability name. Default: `edit_plugins` — the capability WordPress uses for editing plugin code, because snippets run as PHP on the site.

/ Returns

string The capability a user must have to create or change a snippet.

/ Examples

Allow site administrators when plugin editing is disabled

// DISALLOW_FILE_EDIT removes edit_plugins from every role.
// Only lower the gate on a site where you trust everyone it lets in.
add_filter( 'fswa_glue_capability', function ( $capability ) {
    return 'manage_options';
} );

/ Related

Ready

Your next automation is
one sentence away.

$ wp plugin install flowsystems-webhook-actions --activate