Skip to content

Commit 88f61c1

Browse files
committed
Reject button added to privacy bar
1 parent 67d3b82 commit 88f61c1

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

public/class-gdpr-public.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public function privacy_bar() {
156156
$button_text = apply_filters( 'gdpr_privacy_bar_button_text', esc_html__( 'I Agree', 'gdpr' ) );
157157
$privacy_bar_enabled = apply_filters( 'gdpr_privacy_bar_display', $privacy_bar_enabled );
158158
$hide_from_bots = get_option( 'gdpr_hide_from_bots', true );
159+
$reject_button_text = apply_filters( 'gdpr_privacy_bar_reject_button_text', esc_html__( 'Reject', 'gdpr' ) );
159160

160161
if ( ! $privacy_bar_enabled || ( $hide_from_bots && $this->is_crawler() ) ) {
161162
return;
@@ -167,6 +168,7 @@ public function privacy_bar() {
167168
'registered_cookies' => $registered_cookies,
168169
'show_cookie_cat_checkboxes' => $show_cookie_cat_checkboxes,
169170
'button_text' => $button_text,
171+
'reject_button_text' => $reject_button_text,
170172
)
171173
);
172174
}

src/js/public.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ $( function() {
185185
/**
186186
* Close the privacy/reconsent bar.
187187
*/
188-
$( document ).on( 'click', '.gdpr.gdpr-privacy-bar .gdpr-close, .gdpr.gdpr-reconsent-bar .gdpr-close', function() {
188+
$( document ).on( 'click', '.gdpr.gdpr-privacy-bar .gdpr-close, .gdpr.gdpr-reconsent-bar .gdpr-close', '.gdpr.gdpr-privacy-bar .gdpr-reject', function() {
189189
const scrollDistance = $( 'body' ).css( 'top' );
190190
$( '.gdpr-overlay' ).fadeOut();
191191
$( 'body' ).removeClass( 'gdpr-noscroll' );

src/scss/public.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
text-align: center;
118118
@include breakpoint( xxlarge ) {
119119
flex: 1;
120-
padding: 0 100px 0 0;
120+
padding: 0 50px 0 0;
121121
text-align: left;
122122
}
123123
p {
@@ -192,6 +192,7 @@
192192
}
193193
}
194194
.gdpr-buttons {
195+
display: flex;
195196
@include breakpoint( small-only ) {
196197
display: flex;
197198
flex-direction: column;

templates/privacy-bar.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<div class="gdpr-buttons">
3838
<button class="gdpr-preferences" type="button"><?php esc_html_e( 'Privacy Preferences', 'gdpr' ); ?></button>
3939
<button class="gdpr-agreement" type="button"><?php echo esc_html( $args['button_text'] ); ?></button>
40+
<button class="gdpr-agreement gdpr-reject" type="button"><?php echo esc_html( $args['reject_button_text'] ); ?></button>
4041
</div>
4142
<span class="gdpr-close"></span>
4243
</div>

0 commit comments

Comments
 (0)