Compliant with GDPR, CCPA, COPPA, LGPD, PECR, PDPA, PIPEDA, and more.
GDPR 及类似法律要求在设置非必要 Cookie 或处理个人数据之前必须获得同意。WP Consent API 帮助您满足这些要求。
不同插件以不同方式处理同意可能导致冲突或行为不一致。该 API 在整个 WordPress 站点统一了同意处理方式。
WordPress 插件开发者可以使用内置的 API 函数,而无需自行实现同意逻辑。
该 API 允许开发者和插件:
// Check if consent is given for 'statistics'
if (wp_has_consent('statistics')) {
// Load statistics script
}
granteddeniedunknown在加载 Google Analytics 或 Facebook Pixel 等工具之前:
if (wp_has_consent('statistics')) {
// Insert statistics code
}
或在您的 PHP 代码中:
if (wp_has_consent('marketing')){
//do marketing stuff
}