説明
について wpforms_hubspot_api_allow_property
では、HubSpotアドオンのコンタクトプロパティをカスタマイズできます。
パラメータ
- プロパティ
- (配列) (必須)含めたいHubSpotプロパティ。
ソース
wpforms-hubspot/src/Api/Client.php
詳細情報
このフィルターを使用すると、HubSpot APIコンタクトプロパティの処理をカスタマイズし、事前に定義した条件に基づいて動的に除外することができます。特定のプロパティを含めることも、HubSpotアカウントのすべてのプロパティを含めることもできます。
例
/**
* 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 );
利用可能なすべてのプロパティを含めるには、以下のスニペットを使用します:
add_filter( 'wpforms_hubspot_api_allow_property', '__return_true' );