Description
The wpforms_hubspot_api_allow_property
lets you customize contact properties for the HubSpot addon.
Parameters
- $property
- (array) (Required) HubSpot property you’d like to include.
Source
wpforms-hubspot/src/Api/Client.php
More Information
This filter enables you to customize the processing of HubSpot API contact properties, allowing for dynamic exclusion based on predefined conditions. You can include specific properties or all properties from your HubSpot account.
Examples
/**
* Filter whether a specific HubSpot property should be allowed.
*
* @link https://wpforms.com/developers/wpforms_hubspot_api_allow_property/
* @since {VERSION}
*
* @param bool $allowed Whether the property is allowed. Default false.
* @param mixed $property The HubSpot property being checked.
*
* @return bool True to allow the property, false to disallow.
*/
function wpf_hubspot_add_property( $allow, array $property ) {
return $property['groupName'] === 'conversioninformation' ? true : $allow;
}
add_filter( 'wpforms_hubspot_api_allow_property', 'wpf_hubspot_add_property', 10, 2 );
To include all available properties, use the snippet below:
add_filter( 'wpforms_hubspot_api_allow_property', '__return_true' );
Related
Article Reference: How to Add Contact Properties for HubSpot Addon connection.