# jetpack/16.3-a.5/modules/widgets/eu-cookie-law/widget.php

Jetpack – WP Security, Backup, Speed, &amp; Growth, version 16.3-a.5. 44 lines.

- Page: https://pluginprobe.com/plugins/jetpack/16.3-a.5/code/modules/widgets/eu-cookie-law/widget.php
- Raw: https://pluginprobe.com/plugins/jetpack/16.3-a.5/raw/modules/widgets/eu-cookie-law/widget.php
- Modified: 2025-11-24T17:00:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetpack/16.3-a.5/code/modules/widgets/eu-cookie-law/widget.php#L10-L20`.

```php
<?php
/**
 * Widget for Cookies and Consent.
 *
 * @html-template Jetpack_EU_Cookie_Law_Widget::widget
 * @package automattic/jetpack
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit( 0 );
}

// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- HTML template, let Phan handle it.

?>

<div
	class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>"
	data-hide-timeout="<?php echo (int) $instance['hide-timeout']; ?>"
	data-consent-expiration="<?php echo (int) $instance['consent-expiration']; ?>"
	id="eu-cookie-law"
>
	<form method="post" id="jetpack-eu-cookie-law-form">
		<input type="submit" value="<?php echo esc_attr( $instance['button'] ); ?>" class="accept" />
	</form>

	<?php
	if ( 'default' === $instance['text'] || empty( $instance['customtext'] ) ) {
		echo nl2br( esc_html( $instance['default-text'] ) );
	} else {
		echo nl2br( esc_html( $instance['customtext'] ) );
	}
	?>

	<?php
	$is_default_policy = 'default' === $instance['policy-url'] || empty( $instance['custom-policy-url'] );
	$policy_link_url   = $is_default_policy ? $instance['default-policy-url'] : $instance['custom-policy-url'];
	$policy_link_rel   = $is_default_policy ? 'nofollow' : '';
	?>
	<a href="<?php echo esc_url( $policy_link_url ); ?>" rel="<?php echo esc_attr( $policy_link_rel ); ?>">
		<?php echo esc_html( $instance['policy-link-text'] ); ?>
	</a>
</div>

```
