Skip to content

Instantly share code, notes, and snippets.

@hostz-frank
Last active October 17, 2019 10:35
Show Gist options
  • Save hostz-frank/3559c4afd152f6a9b52ef24c4c79bf8d to your computer and use it in GitHub Desktop.
Save hostz-frank/3559c4afd152f6a9b52ef24c4c79bf8d to your computer and use it in GitHub Desktop.
DSGVO-Hinweis bei passwortgeschütztem Inhalt in WordPress
<?php
// Die folgenden Zeilen in die functions.php des aktiven Child-Themes kopieren.
add_filter( 'the_password_form', 'custom_password_form' );
function custom_password_form() {
global $post;
$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
$o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post">
<p class="pw-notice">Bitte beachten Sie, dass das Absenden eines Passworts ein <b>Cookie</b> in ihrem Browser setzt, das sich 10 Tage lang Ihren Zugang "merkt".<br></p>
<label class="pass-label" for="' . $label . '">Passwort: </label> <input name="post_password" id="' . $label . '" type="password" style="background: #ffffff; border:1px solid #999; color:#333333; pad$
</form><p style="font-size:14px;margin:0px;">&nbsp;</p>
';
return $o;
}
@hostz-frank
Copy link
Author

Ergebnis (natürlich ab dem Bereich unter dem lilafarbigen Header):

pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment