gform_mcp_registered_addons

Description

The gform_mcp_registered_addons filter is a last-mile hook over the add-on MCP contributions (the per-add-on tool groups shown on the settings screen). Entries are keyed by namespace. It’s mostly for add-on developers, though a site can also use it to drop an add-on’s tools wholesale.

Usage

add_filter( 'gform_mcp_registered_addons', 'your_function_name' );

Parameters

ParameterTypeDescription
$addonsarrayThe registered add-on MCP contributions, keyed by namespace.

Examples

Drop an Add-On’s Tools Wholesale.

// Remove all tools contributed by a specific add-on.
add_filter( 'gform_mcp_registered_addons', function ( $addons ) {
	unset( $addons['gravityforms-mailchimp'] );
	return $addons;
} );

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 gravityforms/includes/abilities/class-gf-mcp-settings.php

Since

The filter was added in Gravity Forms 3.1.0