Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions admin/class-gdpr-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public function register_settings() {
'gdpr_display_cookie_categories_in_bar' => 'boolval',
'gdpr_hide_from_bots' => 'boolval',
'gdpr_reconsent_template' => 'sanitize_text_field',
'gdpr_no_reply_email' => 'sanitize_text_field',
);
foreach ( $settings as $option_name => $sanitize_callback ) {
register_setting( 'gdpr', $option_name, array( 'sanitize_callback' => $sanitize_callback ) );
Expand Down
19 changes: 19 additions & 0 deletions admin/partials/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@

<table class="form-table">
<tbody>
<tr>
<th scope="row">
<label for="gdpr_no_reply_email"><?php esc_html_e( 'No-Reply email', 'gdpr' ); ?>:</label>
<span class="screen-reader-text"><?php esc_attr_e( 'This is the do not reply email address.', 'gdpr' ); ?></span>
<span data-gdprtooltip="<?php esc_attr_e( 'This is the do not reply email address.', 'gdpr' ); ?>">
<span class="dashicons dashicons-info"></span>
</span>
</th>
<td>
<?php
$sitename = isset( $_SERVER['SERVER_NAME'] ) ? strtolower( sanitize_text_field( wp_unslash( $_SERVER['SERVER_NAME'] ) ) ) : ''; // WPCS: input var ok.
if ( substr( $sitename, 0, 4 ) === 'www.' ) {
$sitename = substr( $sitename, 4 );
}
$no_reply_email = get_option( 'gdpr_no_reply_email', 'noreply@' . $sitename );
?>
<input type="text" name="gdpr_no_reply_email" id="gdpr_no_reply_email" value="<?php echo esc_attr( $no_reply_email ); ?>">
</td>
</tr>
<tr>
<th scope="row">
<label for="gdpr_email_limit"><?php esc_html_e( 'Outgoing email limit', 'gdpr' ); ?>:</label>
Expand Down
4 changes: 3 additions & 1 deletion includes/class-gdpr-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ private static function get_do_not_reply_address() {
$sitename = substr( $sitename, 4 );
}

return apply_filters( 'gdpr_do_not_reply_address', 'noreply@' . $sitename );
$reply_email = get_option( 'gdpr_no_reply_email', 'noreply@' . $sitename );

return apply_filters( 'gdpr_do_not_reply_address', $reply_email );
}

/**
Expand Down
10 changes: 5 additions & 5 deletions includes/class-gdpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ private function define_public_hooks() {
add_action( 'wp_enqueue_scripts', array( $plugin_public, 'enqueue_styles' ) );
add_action( 'wp_enqueue_scripts', array( $plugin_public, 'enqueue_scripts' ) );
add_action( 'init', array( $plugin_public, 'set_plugin_cookies' ) );
add_action( 'wp_footer', array( $plugin_public, 'overlay' ) );
add_action( 'wp_footer', array( $plugin_public, 'privacy_bar' ) );
add_action( 'wp_footer', array( $plugin_public, 'is_consent_needed' ) );
add_action( 'wp_footer', array( $plugin_public, 'privacy_preferences_modal' ) );
add_action( 'wp_footer', array( $plugin_public, 'confirmation_screens' ) );
add_action( 'wp_head', array( $plugin_public, 'overlay' ) );
add_action( 'wp_head', array( $plugin_public, 'privacy_bar' ) );
add_action( 'wp_head', array( $plugin_public, 'is_consent_needed' ) );
add_action( 'wp_head', array( $plugin_public, 'privacy_preferences_modal' ) );
add_action( 'wp_head', array( $plugin_public, 'confirmation_screens' ) );
add_action( 'wp_ajax_disagree_with_terms', array( $plugin_public, 'logout' ) );
add_action( 'wp_ajax_agree_with_terms', array( $plugin_public, 'agree_with_terms' ) );
add_action( 'wp_ajax_gdpr_update_privacy_preferences', array( $plugin_public, 'update_privacy_preferences' ) );
Expand Down