Initial commit: ATT Consent plugin v1.0.0

Google Consent Mode v2 cookie consent plugin with session attribution
preservation, custom script management, and gtag.js/GTM support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 05:45:42 +00:00
commit 6bf9f553de
19 changed files with 2726 additions and 0 deletions

View File

@@ -0,0 +1,118 @@
<?php
/**
* Appearance settings tab.
*
* @package ATT_Consent
* @var array $settings Current settings.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
<?php wp_nonce_field( 'att_cc_save_settings' ); ?>
<input type="hidden" name="action" value="att_cc_save_settings">
<input type="hidden" name="att_cc_tab" value="appearance">
<h2><?php esc_html_e( 'Banner Text', 'att-consent' ); ?></h2>
<table class="form-table">
<tr>
<th scope="row">
<label for="banner_heading"><?php esc_html_e( 'Heading', 'att-consent' ); ?></label>
</th>
<td>
<input type="text" name="banner_heading" id="banner_heading"
value="<?php echo esc_attr( $settings['banner_heading'] ); ?>"
class="large-text">
</td>
</tr>
<tr>
<th scope="row">
<label for="banner_message"><?php esc_html_e( 'Message', 'att-consent' ); ?></label>
</th>
<td>
<textarea name="banner_message" id="banner_message" rows="4"
class="large-text"><?php echo esc_textarea( $settings['banner_message'] ); ?></textarea>
<p class="description"><?php esc_html_e( 'Basic HTML is allowed (links, bold, italic).', 'att-consent' ); ?></p>
</td>
</tr>
<tr>
<th scope="row">
<label for="btn_accept_label"><?php esc_html_e( 'Accept Button Label', 'att-consent' ); ?></label>
</th>
<td>
<input type="text" name="btn_accept_label" id="btn_accept_label"
value="<?php echo esc_attr( $settings['btn_accept_label'] ); ?>" class="regular-text">
</td>
</tr>
<tr>
<th scope="row">
<label for="btn_reject_label"><?php esc_html_e( 'Reject Button Label', 'att-consent' ); ?></label>
</th>
<td>
<input type="text" name="btn_reject_label" id="btn_reject_label"
value="<?php echo esc_attr( $settings['btn_reject_label'] ); ?>" class="regular-text">
</td>
</tr>
<tr>
<th scope="row">
<label for="btn_preferences_label"><?php esc_html_e( 'Preferences Button Label', 'att-consent' ); ?></label>
</th>
<td>
<input type="text" name="btn_preferences_label" id="btn_preferences_label"
value="<?php echo esc_attr( $settings['btn_preferences_label'] ); ?>" class="regular-text">
</td>
</tr>
<tr>
<th scope="row">
<label for="btn_save_label"><?php esc_html_e( 'Save Preferences Label', 'att-consent' ); ?></label>
</th>
<td>
<input type="text" name="btn_save_label" id="btn_save_label"
value="<?php echo esc_attr( $settings['btn_save_label'] ); ?>" class="regular-text">
</td>
</tr>
</table>
<h2><?php esc_html_e( 'Colours', 'att-consent' ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><?php esc_html_e( 'Banner Background', 'att-consent' ); ?></th>
<td><input type="text" name="banner_bg_color" value="<?php echo esc_attr( $settings['banner_bg_color'] ); ?>" class="att-cc-color-picker"></td>
</tr>
<tr>
<th scope="row"><?php esc_html_e( 'Banner Text', 'att-consent' ); ?></th>
<td><input type="text" name="banner_text_color" value="<?php echo esc_attr( $settings['banner_text_color'] ); ?>" class="att-cc-color-picker"></td>
</tr>
<tr>
<th scope="row"><?php esc_html_e( 'Accept Button Background', 'att-consent' ); ?></th>
<td><input type="text" name="btn_accept_bg" value="<?php echo esc_attr( $settings['btn_accept_bg'] ); ?>" class="att-cc-color-picker"></td>
</tr>
<tr>
<th scope="row"><?php esc_html_e( 'Accept Button Text', 'att-consent' ); ?></th>
<td><input type="text" name="btn_accept_text" value="<?php echo esc_attr( $settings['btn_accept_text'] ); ?>" class="att-cc-color-picker"></td>
</tr>
<tr>
<th scope="row"><?php esc_html_e( 'Reject Button Background', 'att-consent' ); ?></th>
<td><input type="text" name="btn_reject_bg" value="<?php echo esc_attr( $settings['btn_reject_bg'] ); ?>" class="att-cc-color-picker"></td>
</tr>
<tr>
<th scope="row"><?php esc_html_e( 'Reject Button Text', 'att-consent' ); ?></th>
<td><input type="text" name="btn_reject_text" value="<?php echo esc_attr( $settings['btn_reject_text'] ); ?>" class="att-cc-color-picker"></td>
</tr>
<tr>
<th scope="row"><?php esc_html_e( 'Preferences Button Background', 'att-consent' ); ?></th>
<td>
<input type="text" name="btn_preferences_bg" value="<?php echo esc_attr( $settings['btn_preferences_bg'] ); ?>" class="att-cc-color-picker">
<p class="description"><?php esc_html_e( 'Use "transparent" for an outline-style button.', 'att-consent' ); ?></p>
</td>
</tr>
<tr>
<th scope="row"><?php esc_html_e( 'Preferences Button Text', 'att-consent' ); ?></th>
<td><input type="text" name="btn_preferences_text" value="<?php echo esc_attr( $settings['btn_preferences_text'] ); ?>" class="att-cc-color-picker"></td>
</tr>
</table>
<?php submit_button(); ?>
</form>