From 2bfa44f79af851270ad94d039566672b9d3e038a Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Fri, 26 Jun 2026 16:43:27 +0800 Subject: [PATCH 1/2] feat(cookie-consent): make consent copy configurable Summary: - Add a normalized copy config group with translated package defaults for banner, modal, footer link, CCPA page, and snackbar strings. - Render server templates and injected CCPA UI from resolved copy values. - Document consumer translation of overrides and add a package changelog. Rationale: - Consumers need to supply product-appropriate privacy copy without editing package source while keeping package defaults in the package text domain. - Copy normalization lets consumers override individual keys without having to duplicate the full default map. Tests: - php -l projects/packages/cookie-consent/src/class-cookie-consent.php - php -l projects/packages/cookie-consent/src/cookie-banner-content.php - php -l projects/packages/cookie-consent/src/ccpa-content.php - PHP copy override smoke test with WordPress function stubs - composer phpcs:lint -- changed PHP files - mise x node@24.15.0 -- pnpm --filter @automattic/jetpack-cookie-consent test - mise x node@24.15.0 -- pnpm --filter @automattic/jetpack-cookie-consent typecheck - mise x node@24.15.0 -- pnpm --filter @automattic/jetpack-cookie-consent build - mise x node@24.15.0 -- pnpm jetpack phan --allow-polyfill-parser packages/cookie-consent (fails: existing class-consent-log-controller.php issues) --- projects/packages/cookie-consent/README.md | 14 +++ .../changelog/wooa7s-1601-configurable-copy | 4 + .../cookie-consent/src/ccpa-content.php | 26 +++-- .../src/class-cookie-consent.php | 98 ++++++++++++++++++- .../src/cookie-banner-content.php | 79 ++++++--------- .../src/modules/cookie-consent/index.ts | 2 +- .../src/modules/cookie-consent/logger.ts | 4 +- .../src/modules/cookie-consent/tracks.ts | 12 +-- .../src/modules/cookie-consent/utils.ts | 2 +- .../src/modules/cookie-consent/view.ts | 4 +- 10 files changed, 168 insertions(+), 77 deletions(-) create mode 100644 projects/packages/cookie-consent/changelog/wooa7s-1601-configurable-copy diff --git a/projects/packages/cookie-consent/README.md b/projects/packages/cookie-consent/README.md index 196c41c69d9a..fab6822d02c1 100644 --- a/projects/packages/cookie-consent/README.md +++ b/projects/packages/cookie-consent/README.md @@ -46,6 +46,20 @@ clear `jetpack_cookie_consent_consent_log_db_version`, call: Filter `jetpack_cookie_consent_config` to override defaults (geo API URL, GDPR/CCPA region lists, cookie policy URL, and the Tracks `event_prefix`). The Tracks event prefix defaults to `jetpack`; set it to `woocommerceanalytics` to keep continuity with the WooCommerce/Unified Analytics Tracks stream. +User-facing banner, preferences modal, footer link, CCPA page, and CCPA snackbar strings are configured through the `copy` group. Package defaults are translated with the `jetpack-cookie-consent` text domain. Consumers that override strings should translate those overrides before returning them from the filter, using their own text domain: + +```php +add_filter( + 'jetpack_cookie_consent_config', + function ( $config ) { + $config['copy']['banner_title'] = __( 'Your privacy settings', 'my-plugin' ); + $config['copy']['ccpa_opt_out_button'] = __( 'Do Not Sell or Share My Personal Information', 'my-plugin' ); + + return $config; + } +); +``` + ## Requirements - PHP >= 7.2 diff --git a/projects/packages/cookie-consent/changelog/wooa7s-1601-configurable-copy b/projects/packages/cookie-consent/changelog/wooa7s-1601-configurable-copy new file mode 100644 index 000000000000..fd09165a0c1f --- /dev/null +++ b/projects/packages/cookie-consent/changelog/wooa7s-1601-configurable-copy @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Make banner and CCPA copy configurable. diff --git a/projects/packages/cookie-consent/src/ccpa-content.php b/projects/packages/cookie-consent/src/ccpa-content.php index 78518ed2bfd1..d69ad1ae57ec 100644 --- a/projects/packages/cookie-consent/src/ccpa-content.php +++ b/projects/packages/cookie-consent/src/ccpa-content.php @@ -8,34 +8,42 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } + +// $config is supplied by Cookie_Consent::get_ccpa_page_content() when this template is included. +$config = isset( $config ) && is_array( $config ) ? $config : array(); +if ( isset( $config['copy'] ) && is_array( $config['copy'] ) ) { + $copy = $config['copy']; +} else { + $copy = \Automattic\Jetpack\CookieConsent\Cookie_Consent::get_default_copy(); +} ?> -

+

-

+

-

+

-

+

-

+

@@ -43,7 +51,7 @@
- +
diff --git a/projects/packages/cookie-consent/src/class-cookie-consent.php b/projects/packages/cookie-consent/src/class-cookie-consent.php index 37fab8a79250..b2509af904b0 100644 --- a/projects/packages/cookie-consent/src/class-cookie-consent.php +++ b/projects/packages/cookie-consent/src/class-cookie-consent.php @@ -221,6 +221,8 @@ public static function maybe_create_ccpa_page() { // Build the page content with blocks. $content = self::get_ccpa_page_content(); + $config = self::get_config(); + $copy = $config['copy']; // Create the page in a single call so the created-once flag is only set // once the full page (with content) has actually persisted. A two-step @@ -228,7 +230,7 @@ public static function maybe_create_ccpa_page() { // failed update would leave a permanently published, empty page. $page_id = wp_insert_post( array( - 'post_title' => __( 'Your Privacy Choices', 'jetpack-cookie-consent' ), + 'post_title' => $copy['ccpa_page_title'], 'post_name' => $page_slug, 'post_status' => 'publish', 'post_type' => 'page', @@ -330,6 +332,7 @@ private static function get_ccpa_page_content() { } ob_start(); + $config = self::get_config(); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable include $template_path; return ob_get_clean(); } @@ -469,8 +472,9 @@ public static function set_footer_navigation_link_attributes( $hooked_block ) { // Process GDPR "Manage Privacy Preferences" link last. if ( ! $manage_preferences_processed ) { + $config = self::get_config(); $hooked_block['attrs']['url'] = '#manage-preferences'; - $hooked_block['attrs']['label'] = __( 'Manage Privacy Preferences', 'jetpack-cookie-consent' ); + $hooked_block['attrs']['label'] = $config['copy']['manage_preferences_link']; $hooked_block['attrs']['kind'] = 'custom'; $hooked_block['attrs']['metadata'] = array( 'name' => 'jetpack-cookie-consent-gdpr-manage-preferences-link', @@ -627,6 +631,9 @@ public static function add_ccpa_group_directives( $block_content, $block ) { // $block_content = $tags->get_updated_html(); } + $config = self::get_config(); + $copy = $config['copy']; + // Build the snackbar HTML. $snackbar_html = sprintf( ' ', - esc_html__( 'Your browser has been successfully opted out from sharing personal data.', 'jetpack-cookie-consent' ), - esc_attr__( 'Dismiss', 'jetpack-cookie-consent' ) + esc_html( $copy['ccpa_snackbar_success'] ), + esc_attr( $copy['ccpa_snackbar_dismiss_label'] ) ); // Insert the snackbar inside the group block (before the closing ). @@ -648,12 +655,85 @@ public static function add_ccpa_group_directives( $block_content, $block ) { // return $block_content; } + /** + * Get default UI copy. + * + * Defaults are translated in the package text domain. Consumers can override + * any key through the `copy` config group and translate those overrides in + * their own text domain before returning them from the config filter. + * + * @since $$next-version$$ + * + * @return array Default copy keyed by semantic UI location. + */ + public static function get_default_copy() { + return array( + 'banner_title' => __( 'Use of your personal data', 'jetpack-cookie-consent' ), + 'banner_description' => __( 'We and our partners process your personal data, such as browsing data, IP addresses, cookie information, and other unique identifiers, based on your consent and/or our legitimate interest to improve our website, marketing activities, and your user experience.', 'jetpack-cookie-consent' ), + 'banner_accept_button' => __( 'Accept', 'jetpack-cookie-consent' ), + 'banner_reject_button' => __( 'Reject', 'jetpack-cookie-consent' ), + 'banner_customize_button' => __( 'Customize', 'jetpack-cookie-consent' ), + 'modal_title' => __( 'Customize preferences', 'jetpack-cookie-consent' ), + 'modal_close_label' => __( 'Close modal', 'jetpack-cookie-consent' ), + 'modal_description' => __( 'Your privacy is important to us. We and our partners use, store, and process your personal data to improve our website, such as by improving security or conducting analytics, marketing activities to help deliver relevant marketing or content, and your user experience, such as by remembering your account name or language settings where applicable. You can customize your cookie settings below. Learn more in our', 'jetpack-cookie-consent' ), + 'privacy_policy_link' => __( 'Privacy Policy', 'jetpack-cookie-consent' ), + 'modal_links_conjunction' => __( 'and', 'jetpack-cookie-consent' ), + 'cookie_policy_link' => __( 'Cookie Policy', 'jetpack-cookie-consent' ), + 'category_toggle_label' => __( 'Toggle category description', 'jetpack-cookie-consent' ), + 'required_category_label' => __( 'Required', 'jetpack-cookie-consent' ), + 'always_active_label' => __( 'Always active', 'jetpack-cookie-consent' ), + 'required_category_description' => __( 'These cookies are essential for our websites and services to perform basic functions and are necessary for us to operate certain features. Examples include your IP address, browser type, requested URLs, response codes, and operating system data.', 'jetpack-cookie-consent' ), + 'analytics_category_label' => __( 'Analytics', 'jetpack-cookie-consent' ), + 'analytics_category_description' => __( 'These cookies allow us to improve performance by collecting information on how users interact with our websites.', 'jetpack-cookie-consent' ), + 'advertising_category_label' => __( 'Advertising', 'jetpack-cookie-consent' ), + 'advertising_category_description' => __( 'These cookies are set by us and our advertising partners to provide you with relevant content and to understand that content\'s effectiveness.', 'jetpack-cookie-consent' ), + 'save_preferences_button' => __( 'Save preferences', 'jetpack-cookie-consent' ), + 'accept_all_button' => __( 'Accept all', 'jetpack-cookie-consent' ), + 'reject_all_button' => __( 'Reject all', 'jetpack-cookie-consent' ), + 'manage_preferences_link' => __( 'Manage Privacy Preferences', 'jetpack-cookie-consent' ), + 'ccpa_page_title' => __( 'Your Privacy Choices', 'jetpack-cookie-consent' ), + 'ccpa_intro' => __( 'We value your privacy and want you to feel in control of your personal information. Like most websites, we use cookies and similar tools to improve your website experience and show you relevant ads. Sometimes we share this information with trusted partners to do so.', 'jetpack-cookie-consent' ), + 'ccpa_laws_notice' => __( 'Some U.S. state laws consider this kind of data sharing a sale or sharing of personal information. Depending on where you live, you may have the right to opt out.', 'jetpack-cookie-consent' ), + 'ccpa_heading' => __( 'How to Opt Out', 'jetpack-cookie-consent' ), + 'ccpa_browser_opt_out' => __( 'Browser Opt-Out: Click the Opt Out button below to stop your browser from sharing this data.', 'jetpack-cookie-consent' ), + 'ccpa_account_opt_out' => __( 'Account Opt-Out: To apply this choice to your account, check the box and enter your email.', 'jetpack-cookie-consent' ), + 'ccpa_gpc_opt_out' => __( 'Automatic Opt-Out: If you use a browser with Global Privacy Control (GPC) turned on, we will recognize it and respect your choice automatically.', 'jetpack-cookie-consent' ), + 'ccpa_preferences_notice' => __( 'Your preferences will only affect how we use your information for personalized ads and similar activities. It will not affect how we use your information for other purposes, like security or site functionality.', 'jetpack-cookie-consent' ), + 'ccpa_button_instruction' => __( 'Click the Opt Out button to stop this browser from sharing personal data.', 'jetpack-cookie-consent' ), + 'ccpa_opt_out_button' => __( 'Opt Out', 'jetpack-cookie-consent' ), + 'ccpa_snackbar_success' => __( 'Your browser has been successfully opted out from sharing personal data.', 'jetpack-cookie-consent' ), + 'ccpa_snackbar_dismiss_label' => __( 'Dismiss', 'jetpack-cookie-consent' ), + ); + } + + /** + * Normalize configured copy by merging consumer overrides with defaults. + * + * @param array $copy Copy values supplied by configuration. + * @param array $defaults Default copy values. + * @return array Normalized copy. + */ + private static function normalize_copy( $copy, $defaults ) { + if ( ! is_array( $copy ) ) { + return $defaults; + } + + foreach ( $copy as $key => $value ) { + if ( is_string( $key ) && is_scalar( $value ) ) { + $defaults[ $key ] = (string) $value; + } + } + + return $defaults; + } + /** * Get configuration with filters * * @return array Configuration array */ private static function get_config() { + $default_copy = self::get_default_copy(); $default_config = array( 'geo_api_url' => 'https://public-api.wordpress.com/geo/', 'geo_cookie_duration' => 6 * HOUR_IN_SECONDS, // 6 hours. @@ -715,6 +795,7 @@ private static function get_config() { 'show_on_error' => true, // Show banner if geolocation fails. 'gdpr_honors_gpc' => true, // Honor a Global Privacy Control signal as an opt-out in GDPR regions. 'event_prefix' => 'jetpack', // Tracks event name prefix; set to 'woocommerceanalytics' for Unified Analytics continuity. + 'copy' => $default_copy, ); /** @@ -722,7 +803,14 @@ private static function get_config() { * * @param array $config Configuration array */ - return apply_filters( 'jetpack_cookie_consent_config', $default_config ); + $config = apply_filters( 'jetpack_cookie_consent_config', $default_config ); + if ( ! is_array( $config ) ) { + $config = $default_config; + } + + $config['copy'] = self::normalize_copy( $config['copy'] ?? array(), $default_copy ); + + return $config; } /** diff --git a/projects/packages/cookie-consent/src/cookie-banner-content.php b/projects/packages/cookie-consent/src/cookie-banner-content.php index 441550cf6532..55fe92a10772 100644 --- a/projects/packages/cookie-consent/src/cookie-banner-content.php +++ b/projects/packages/cookie-consent/src/cookie-banner-content.php @@ -11,6 +11,11 @@ // $config is supplied by Cookie_Consent::render_banner() when this template is included. $config = isset( $config ) && is_array( $config ) ? $config : array( 'cookie_policy_url' => '' ); +if ( isset( $config['copy'] ) && is_array( $config['copy'] ) ) { + $copy = $config['copy']; +} else { + $copy = \Automattic\Jetpack\CookieConsent\Cookie_Consent::get_default_copy(); +} ?> @@ -95,13 +95,13 @@ class="jetpack-cookie-consent__modal" > @@ -228,19 +210,14 @@ class="jetpack-cookie-consent__description-toggle" @@ -252,21 +229,21 @@ class="jetpack-cookie-consent__description-toggle" class="wp-element-button jetpack-cookie-consent__button jetpack-cookie-consent__button--primary" data-wp-on--click="actions.savePreferences" > - + diff --git a/projects/packages/cookie-consent/src/modules/cookie-consent/index.ts b/projects/packages/cookie-consent/src/modules/cookie-consent/index.ts index c95c7ed2674d..f1f253a5c751 100644 --- a/projects/packages/cookie-consent/src/modules/cookie-consent/index.ts +++ b/projects/packages/cookie-consent/src/modules/cookie-consent/index.ts @@ -1,5 +1,5 @@ /** - * Shoppers Privacy Module Entry Point + * Cookie Consent Module Entry Point * * This module handles GDPR cookie consent and CCPA opt-out functionality. */ diff --git a/projects/packages/cookie-consent/src/modules/cookie-consent/logger.ts b/projects/packages/cookie-consent/src/modules/cookie-consent/logger.ts index 3f5df0f0edf5..cc2bb44a796f 100644 --- a/projects/packages/cookie-consent/src/modules/cookie-consent/logger.ts +++ b/projects/packages/cookie-consent/src/modules/cookie-consent/logger.ts @@ -1,7 +1,7 @@ /** - * Shoppers Privacy Controls Logger Integration + * Cookie Consent Controls Logger Integration * - * Listens to consent events from the shoppers privacy controls and logs them via REST API. + * Listens to consent events from the cookie consent controls and logs them via REST API. * This file should only be loaded when consent logging is enabled. * */ diff --git a/projects/packages/cookie-consent/src/modules/cookie-consent/tracks.ts b/projects/packages/cookie-consent/src/modules/cookie-consent/tracks.ts index 2f90c5f5e1ce..32d2ca3d3166 100644 --- a/projects/packages/cookie-consent/src/modules/cookie-consent/tracks.ts +++ b/projects/packages/cookie-consent/src/modules/cookie-consent/tracks.ts @@ -1,5 +1,5 @@ /** - * Shoppers Privacy Tracking + * Cookie Consent Tracking * * Privacy-specific tracking wrappers for Tracks. */ @@ -10,7 +10,7 @@ import type { ConsentPreferences } from './types'; /** * Track privacy banner view * - * Fired when the cookie consent banner is displayed to the shopper. + * Fired when the cookie consent banner is displayed to the visitor. */ export function trackPrivacyBannerView(): void { recordEvent( 'privacy_banner_view', getCommonProperties() ); @@ -33,7 +33,7 @@ export function trackPrivacyBannerAccept( preferences: ConsentPreferences ): voi /** * Track privacy banner reject button click * - * Fired when shopper clicks "Reject All" in customize modal. + * Fired when the visitor clicks "Reject All" in customize modal. */ export function trackPrivacyBannerReject(): void { recordEvent( 'privacy_banner_button_reject', getCommonProperties() ); @@ -42,7 +42,7 @@ export function trackPrivacyBannerReject(): void { /** * Track privacy banner customize button click * - * Fired when shopper clicks "Customize" to open the preferences modal. + * Fired when the visitor clicks "Customize" to open the preferences modal. */ export function trackPrivacyBannerCustomize(): void { recordEvent( 'privacy_banner_button_customize', getCommonProperties() ); @@ -51,7 +51,7 @@ export function trackPrivacyBannerCustomize(): void { /** * Track "Manage Privacy Preferences" link click * - * Fired when shopper opens preferences modal from the footer link. + * Fired when the visitor opens preferences modal from the footer link. */ export function trackPrivacyManageOpen(): void { recordEvent( 'privacy_manage_open', getCommonProperties() ); @@ -60,7 +60,7 @@ export function trackPrivacyManageOpen(): void { /** * Track CCPA opt-out button click * - * Fired when shopper submits the CCPA "Do Not Sell/Share" opt-out. + * Fired when the visitor submits the CCPA "Do Not Sell/Share" opt-out. */ export function trackPrivacyPolicyOptOut(): void { recordEvent( 'privacy_policy_page_button_opt_out', getCommonProperties() ); diff --git a/projects/packages/cookie-consent/src/modules/cookie-consent/utils.ts b/projects/packages/cookie-consent/src/modules/cookie-consent/utils.ts index 8dd3359da6c8..490beafc701e 100644 --- a/projects/packages/cookie-consent/src/modules/cookie-consent/utils.ts +++ b/projects/packages/cookie-consent/src/modules/cookie-consent/utils.ts @@ -129,7 +129,7 @@ export function handleConsentByRegion( setConsentType( 'optin' ); // A Global Privacy Control signal is a clear opt-out request, so honor it as a - // rejection: force-deny non-essential categories and skip the banner. The shopper + // rejection: force-deny non-essential categories and skip the banner. The visitor // can still grant consent later via the "Manage Privacy Preferences" footer link. // Gated by a config flag so the legal decision is a value, not a code change; // the conservative default (honor GPC) applies when the flag is omitted. diff --git a/projects/packages/cookie-consent/src/modules/cookie-consent/view.ts b/projects/packages/cookie-consent/src/modules/cookie-consent/view.ts index 0a57321d7706..af9e572494bd 100644 --- a/projects/packages/cookie-consent/src/modules/cookie-consent/view.ts +++ b/projects/packages/cookie-consent/src/modules/cookie-consent/view.ts @@ -1,5 +1,5 @@ /** - * Shoppers Privacy Controls Interactivity + * Cookie Consent Controls Interactivity * * Single store handling both GDPR cookie banner and CCPA opt-out functionality. * Uses separate contexts for each UI component while sharing actions and initialization. @@ -547,7 +547,7 @@ const { actions } = store( 'jetpack/cookie-consent', { if ( 'isGdprManageLink' in context ) { gdprManageLinkContexts.add( context ); - // Keep the footer link visibility in sync after the shopper saves consent. + // Keep the footer link visibility in sync after the visitor saves consent. // Without this, the link stays hidden until a full page reload. const config = getConfig() as unknown as StoreConfig; if ( ! manageLinkConsentListenerRegistered ) { From e4623716c86b71559b09890f43f22123e649f88e Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Mon, 29 Jun 2026 14:57:47 +0800 Subject: [PATCH 2/2] fix: harden cookie-consent copy fallback and flag dropped overrides --- .../cookie-consent/src/ccpa-content.php | 6 +--- .../src/class-cookie-consent.php | 36 ++++++++++++++++++- .../src/cookie-banner-content.php | 6 +--- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/projects/packages/cookie-consent/src/ccpa-content.php b/projects/packages/cookie-consent/src/ccpa-content.php index d69ad1ae57ec..c251cab455f1 100644 --- a/projects/packages/cookie-consent/src/ccpa-content.php +++ b/projects/packages/cookie-consent/src/ccpa-content.php @@ -11,11 +11,7 @@ // $config is supplied by Cookie_Consent::get_ccpa_page_content() when this template is included. $config = isset( $config ) && is_array( $config ) ? $config : array(); -if ( isset( $config['copy'] ) && is_array( $config['copy'] ) ) { - $copy = $config['copy']; -} else { - $copy = \Automattic\Jetpack\CookieConsent\Cookie_Consent::get_default_copy(); -} +$copy = \Automattic\Jetpack\CookieConsent\Cookie_Consent::get_copy( $config ); ?> diff --git a/projects/packages/cookie-consent/src/class-cookie-consent.php b/projects/packages/cookie-consent/src/class-cookie-consent.php index b2509af904b0..af2e949de312 100644 --- a/projects/packages/cookie-consent/src/class-cookie-consent.php +++ b/projects/packages/cookie-consent/src/class-cookie-consent.php @@ -332,6 +332,7 @@ private static function get_ccpa_page_content() { } ob_start(); + // Get config for template (consumed by ccpa-content.php via include scope). $config = self::get_config(); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable include $template_path; return ob_get_clean(); @@ -706,6 +707,24 @@ public static function get_default_copy() { ); } + /** + * Resolve UI copy for a template, backfilling any missing keys with defaults. + * + * Templates normally receive a fully normalized `copy` group from get_config(), + * but they can also be included directly (tests, Storybook). Routing through this + * helper guarantees every key is present so a partial or absent `copy` array can't + * cause undefined-index access. + * + * @since $$next-version$$ + * + * @param array $config Configuration array, which may lack a normalized `copy` group. + * @return array Copy with every key present. + */ + public static function get_copy( $config = array() ) { + $copy = is_array( $config ) && isset( $config['copy'] ) ? $config['copy'] : array(); + return self::normalize_copy( $copy, self::get_default_copy() ); + } + /** * Normalize configured copy by merging consumer overrides with defaults. * @@ -719,9 +738,24 @@ private static function normalize_copy( $copy, $defaults ) { } foreach ( $copy as $key => $value ) { - if ( is_string( $key ) && is_scalar( $value ) ) { + if ( ! is_string( $key ) ) { + continue; + } + + if ( is_scalar( $value ) ) { $defaults[ $key ] = (string) $value; + continue; } + + // A non-scalar override can't render, so the default is kept. Surface it + // so an integrating developer notices the override was dropped instead of + // silently shipping the default copy. + _doing_it_wrong( + __METHOD__, + /* translators: %s is the copy configuration key. */ + esc_html( sprintf( __( 'Cookie consent copy override for "%s" was ignored because it is not a scalar value.', 'jetpack-cookie-consent' ), $key ) ), + '' + ); } return $defaults; diff --git a/projects/packages/cookie-consent/src/cookie-banner-content.php b/projects/packages/cookie-consent/src/cookie-banner-content.php index 55fe92a10772..9dd721a56ea0 100644 --- a/projects/packages/cookie-consent/src/cookie-banner-content.php +++ b/projects/packages/cookie-consent/src/cookie-banner-content.php @@ -11,11 +11,7 @@ // $config is supplied by Cookie_Consent::render_banner() when this template is included. $config = isset( $config ) && is_array( $config ) ? $config : array( 'cookie_policy_url' => '' ); -if ( isset( $config['copy'] ) && is_array( $config['copy'] ) ) { - $copy = $config['copy']; -} else { - $copy = \Automattic\Jetpack\CookieConsent\Cookie_Consent::get_default_copy(); -} +$copy = \Automattic\Jetpack\CookieConsent\Cookie_Consent::get_copy( $config ); ?>